最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
fck高度自适应插件
时间:2011-02-20 编辑:简简单单 来源:一聚教程网
fck高度自适应插件
打开插件所在文件:/editor/plugins/autogrow/fckplugin.js
找到第65行:
window.frameelement.height = imainframesize ;
将其修改为:
代码如下:
这样就可以兼容ie和火狐浏览器了。
启用插件:
打开文件:/fckeditor/fckconfig.js
启用这两行:
fckconfig.plugins.add( 'autogrow' ) ;
fckconfig.autogrowmax = 600 ;
autogrowmax是限制最高高度。可以根据需要自行设置。
function fckautogrow_check()
{
var oinnerdoc = fck.editordocument ;
var iframeheight, iinnerheight ;
if ( fckbrowserinfo.isie )
{
iframeheight = fck.editorwindow.frameelement.offsetheight ;
iinnerheight = oinnerdoc.body.scrollheight ;
}
else
{
iframeheight = fck.editorwindow.innerheight ;
iinnerheight = oinnerdoc.body.offsetheight ;
}
var idiff = iinnerheight - iframeheight ;
if ( idiff != 0 )
{
var imainframesize = window.frameelement.offsetheight ;
if ( idiff > 0 && imainframesize < fckconfig.autogrowmax )
{
imainframesize += idiff ;
if ( imainframesize > fckconfig.autogrowmax )
imainframesize = fckconfig.autogrowmax ;
}
else if ( idiff < 0 && imainframesize > fckautogrow_min )
{
imainframesize += idiff ;
if ( imainframesize < fckautogrow_min )
imainframesize = fckautogrow_min ;
}
else
return ;
window.frameelement.height = imainframesize;
window.frameelement.style.px";
// gecko browsers use an onresize handler to update the innermost
// iframe's height. if the document is modified before the onresize
// is triggered, the plugin will miscalculate the new height. thus,
// forcibly trigger onresize. #1336
if ( typeof window.onresize == 'function' )
window.onresize() ;
}
}
-
下一个: html5简单实例
相关文章
- Iframe根据内容自适应高度和宽度 03-15
- iframe高度自适应代码分享,本人做项目经常用到的 11-04
- 解决iframe高度自适应各种方法 10-19
- div高度自适应方法总结 02-20
- iframe自适应高度实现代码 12-12
- div 使用float后自适应高度无效解决办法 10-16