Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameParamReturn설명
replace{String} html
자신을 교체합니다.
remove

자신을 제거합니다.
setSrc{String} url
src를 교체합니다.
setWidth{Number} value,
{String} [unit]

너비를 설정합니다.
setHeight{Number} value,
{String} [unit]

높이를 설정합니다.


replace (html)

  • html <String> 교체할 HTML String

자신을 파라메터로 넘겨받은 HTML String으로 교체합니다.

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.replace('<span>Image replace</span>');

remove

자신을 제거합니다.

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.remove();

setSrc

  • url <String> 이미지 src에 설정할 URL

이미지의 src 속성을 파라메터로 넘겨받은 url로 설정합니다.

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.setSrc('/images/test.png');

setWidth

  • value
  • unit

이미지의 너비를 설정합니다.

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.setWidth();

setHeight

  • value
  • unit

이미지의 높이를 설정합니다.

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.setWidth();