I don't know how is your layout defined, but I did build a layout with a main container
(#container
) div with a left panel
(#leftpanel
) and right panel with an editor
(#editor
), I am using .hide()
and .show()
methods from JQuery to hide and show the #leftpanel
(you can use JQuery .toggle()
method to expand and collapse the left panel or whatever you want, .slideUp()
... etc) and the #editor
div and the content (ckeditor) is always resized as expected
A quick example using .toggle()
:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://ckeditor.com/apps/ckeditor/4.4.0/ckeditor.js"></script>
<link rel="stylesheet" type="text/css" href="http://ckeditor.com/apps/ckeditor/4.4.0/skins/moono/editor_gecko.css?t=E3OD"></link>
<script>
var editor;
CKEDITOR.on( 'instanceReady', function( ev ) {
editor = ev.editor;
});
</script>
</head>
<body>
<div id="container">
<div id="leftpanel" style="margin-right: 1px; border: 1px solid black; float: left; width: 30%; position: relative; display: block; height: 305px;">
<p>Left panel</p>
</div>
<div id="editor" style="position: relative; overflow: auto;">
<form>
<textarea class="ckeditor" id="editor1"></textarea>
</form>
</div>
<input id="hide" type="button" value="hide"/>
<input id="show" type="button" value="show"/>
</div>
<script>
$("#hide").click(function(){
$("#leftpanel").toggle("slow");
});
$("#show").click(function(){
$("#leftpanel").toggle("slow");
});
</script>
</body>
</html>
I don't know if this is what you need but hope this helps.