Page tree

Versions Compared

Key

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

...

이미지를 편집하는데 사용되는 API 모델입니다.

Methods

...

Table of Contents

...

maxLevel

...

3

...

minLevel3


replace(html)

  • html <String> 교체할 HTML String.

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

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

remove()

Element 자신을 제거합니다.

Status
subtletrue
colourRed
title모든 Element를 제거할 경우 이후의 작업에서 오류가 발생할 수 있습니다.

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 = 'px']);

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

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

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

setHeight(value[, unit = 'px']);

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

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

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