dimensions()
Gets the current dimensions of the editor.
Syntax
var dimensions = instance.dimensions();
Return
Type: Object
Object with the properties width
and height
.
Example
Get the current width and height:
var textarea = ...;
var dimensions = sceditor.instance(textarea).dimensions();
var width = dimensions.width;
var height = dimensions.height;
Sets the current dimensions of the editor.
Syntax
instance.dimensions(width, height[, save]);
Parameters
width
Type: int or string
The width in pixels or a string percentage e.g. 100%
.
height
Type: int or string
The height in pixels or a string percentage e.g. 100%
.
save
Type: boolean
Default: true
If to save the new sizes, this should normally be left as true.
The saved sizes are used for things like restoring from maximized state.
Example
Set the current width to 100%
and the height to 300px
:
var textarea = ...;
sceditor.instance(textarea).dimensions('100%', 300);