Page tree

Versions Compared

Key

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

...

  • html <String> 교체할 HTML String.

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

...

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

setSrc(url)

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

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

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

setWidth(value[, unit]);

  • value <Number> 너비.
  • unit <String> 단위 ('px' 또는 '%'). 기본값 'px'.

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

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

setHeight(value[, unit]);

  • value <Number> 높이.
  • unit <String> 단위 ('px' 또는 '%'). 기본값 'px'.

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

Code Block
languagejs
themeEmacs
var image = editor.getAPIModelById('id');
image.setHeight(200);
image.setWidth(setHeight(100, 'px');