페이지 이력
...
설명
페이지의 속성값을 구합니다.
구문
function setProperty('name', 'value');
파라미터
name: 속성명
name
반환값
유형 설명 name
string
string
background-color
color
value: "rgba(0, 0, 0, 1)"
반환값
Type : 위의 표 참고
API 가 성공적으로 수행된 경우 : 정상값
API 가 성공적으로 수행 되지 않은 경우 : undefined
코드 예제
$wp.content.getPage(pageId).getProperty('background-color');
...
설명
요소(Element)의 속성을 설정합니다. 요소(Element)마다 지원되는 속성은 다른 값을 가지고 있습니다.
구문
function setProperty('name', 'value') ;
파라미터
name: 속성명
value: 속성값
지원 element
name
value
유형 설명 common (단, video element는 지원하지 않음)
width
number
value 단위: px
height
number
value 단위: px
left
number
value 단위: px
top
number
value 단위: px
visibility
string
value: "visible,hidden"
opacity
number
value: 0.0~1.0
rotation
number
value: 0~360
size
Object
{width: 0, height: 0}
position
Object
{left: 0, top: 0}
image
flip-x
boolean
-
flip-y
boolean
-
source
string
file 절대 경로(getRootDirectory()를 참조하여 생성할 수 있습니다.)
flip
Object
valueObject = {x: false, y: false}
video
source
string
file 절대 경로(getRootDirectory()를 참조하여 생성할 수 있습니다.)
text
font-size
number
value: font size
font-variant
string
value: normal, small-caps
font-color
color
value: "rgba(0, 0, 0, 1)"
background-color
color
value: "rgba(0, 0, 0, 1)"
font-weight
string
value: normal, bold
font-style
string
value: normal, italic
text-decoration
string
value: none, line-through, underline
letter-spacing
number
value 단위: 'px' (0-50)
horizontal-align
string
value: left,right,center
vertical-align
string
value: top,middle,bottom
text
string
string
반환값
Type: bool
API가 성공적으로 수행된 경우: true
API가 성공적으로 수행되지 않은 경우: false
제한 사항
지원하지 않는 속성(파라미터의 Table에 작성되지 않은 property)을 수정할 경우, W Player 재생에 영향을 미칠 수 있습니다.
코드 예제
$wp.content.getPage(pageId).getElement(‘Text1’).setProperty(‘text’, ‘Hello World!’);
기타
Image/Video 요소 - Source 속성의 파라미터는 다음과 같이 설정할 수 있습니다.
var imagePath = $wp.local.getRootDirectory() + “/testImage.png”;
다음을 참고하세요. ▶ $wp.local. getRootDirectory();
$wp.content.getPage(pageId).getElement(‘Image1’).setProperty(‘source’, imagePath);
...
설명
요소(Element)의 속성을 값을 구합니다.
구문
function getProperty (‘name’);
파라미터
name: 속성명
지원 요소(Element)
name
반환값
유형 설명 common (단, video element는 Lock을 제외한 나머지는 지원하지 않음)
width
number
value 단위: px
height
number
value 단위: px
left
number
value 단위: px
top
number
value 단위: px
visibility
string
value: "visible,hidden"
opacity
number
value: 0.0~1.0
rotation
number
value: 0~360
size
Object
{width: 0, height: 0}
position
Object
{left: 0, top: 0}
lock-position-size
boolean
-
lock-design
boolean
-
lock-content
boolean
-
image
flip-x
boolean
-
flip-y
boolean
-
source
string
file 절대 경로
flip
Object
{x: false, y: false}
video
source
string
file 절대 경로
web content
user-data
Object
{"key","value"}
text
font-size
number
value: font size
font-variant
string
value: normal, small-caps
font-color
color
value: "rgba(0, 0, 0, 1)"
background-color
color
value: "rgba(0, 0, 0, 1)"
font-weight
string
value: normal, bold
font-style
string
value: normal, italic
text-decoration
string
value: none, line-through, underline
letter-spacing
number
value 단위: 'px' (0-50)
horizontal-align
string
value: left,right,center
vertical-align
string
value: top,middle,bottom
text
string
string
반환값
Type: 위 표 참고
API가 성공적으로 수행된 경우: 정상값
API가 성공적으로 수행되지 않은 경우: undefined
코드 예제
$wp.content.getPage(pageId).getElement(‘Text1’).getProperty(‘text’);
...