由于它是一个 textarea ,我在 html 属性中尝试了 cols="50" 但它不起作用。
另外,我从上一个问题中找到了答案。他说我可以通过添加来做到这一点。CKEDITOR.instances.myinstance.resize(1000, 900);
然而,尺寸仍然没有改变。
这是我尝试的代码,谢谢。
Updated
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="../plugin/jquery-1.6.1.min.js"></script>
<script src="../plugin/jquery.validate.min.js"></script>
<script type="text/javascript" src="../plugin/ckeditor/ckeditor.js"></script>
<script>
$(document).ready(function(){
$("#addlist").validate();
var editor = CKEDITOR.replace('editor1');
var div = document.getElementById('editor');
editor.resize($(div).width(),'900');
});
</script>
</head>
<body>
<form method="post" action="confirm.php">
<p><br />
<div id="editor">
<textarea id="editor1" name="editor1">
</div>
<? if (isset($_GET['file']))
{$filepath=$_GET['file'];
require_once("../template/".$filepath);}?> </textarea>
</p>
</br>
File Name </br>
<b>(Naming Without .html e.g. MyTemplate1) :</b>
</br>
<input id="tname" name="tname" class="required" />
<input type="submit" />
</p>
</form>
</body>
</html>
尝试关注
要实现此目的,请使用resize http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#resize函数定义编辑器界面的尺寸,为窗口分配宽度和高度值(以像素或 CSS 接受的单位为单位)。
// Set editor width to 100% and height to 350px.
editor.resize( '100%', '350' )
设置高度值时,使用 isContentHeight 参数来决定该值是应用于整个编辑器界面还是仅应用于编辑区域。
// The height value now applies to the editing area.
editor.resize( '100%', '350', true )
http://docs.cksource.com/CKEditor_3.x/Howto/Editor_Size_On_The_Fly http://docs.cksource.com/CKEditor_3.x/Howto/Editor_Size_On_The_Fly
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)