网站制作学习网经验与学习→正文:sina新浪编辑器修改宽度
字体:

sina新浪编辑器修改宽度

经验与学习 2011/1/18 18:11:29  点击:不统计


经常用新浪编辑器,sinaeidtor,挺好用的,后来发现有的时候编辑器的宽度和高度不能调节,后来经过仔细研究并进行了修改代码

如下:
修改新浪编辑器原来上面说是修改iframe即可,可是编辑框根本不会发生变化,需要改新浪编辑器宽度,高度则要对js进行修改。修

改的js为editor.js代码如下修改是从第70行道第86行。

<div id='EDiaryEditor'style='width: 721px;'>//这里是设置整个编辑框的宽度,修改成自己需要的宽度
<div id='EDiaryEditorToolBar' style='position: relative; width: 721px; height: 69px; //设置顶部的宽度高度,宽度不变

,高度跟上面增加量一样background-image: url(images/editor/toolbar_bg.gif);'>\
    WWW.FORASP.CN<div id='EDiaryEditorFontFamilyMenu' title='字体' style='position: absolute; left: 80px; top: 12px;width: 92px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;' action='Family'unselectable='on'>字体</div>\
     <div id='EDiaryEditorFontSizeMenu' title='字号' style='position: absolute;left: 177px; top: 12px; width: 66px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;'action='Size' unselectable='on'>字号</div>\
     <div id='EDiaryEditorFontStyleMenu' title='段落' style='position: absolute;left: 245px; top: 12px; width: 66px; height: 18px; line-height: 20px; padding-left: 4px; cursor: pointer;'action='Style' unselectable='on'>段落</div>\
    </div>\
    <div style='width: 721px; height: 25px; background-image: url(images/editor/title_bg.gif);'>\这里是编辑器水平标尺宽度改成同上
  www.forasp.cn </div>\
  原创文章请保留 <div style='height: 500px; background-image: url(images/editor/guage.gif); padding-left: 48px; width: 710px!important ; width:721px;' id='EDiaryEditorContent'>\这里是编辑器内部编辑框宽度同上
     <iframe id='editor_body_area' name='editor_body_area' style='width: 635px;height: 300px; border-width: 0px; overflow-x: atuo; display: nones;' frameborder='0'></iframe>\这里是编辑框内容宽度
     <textarea id='editor_body_textarea' name='editor_body' style='width: 448px;height: 302px; border-width: 0px; padding-top:8px; display: none;'></textarea>\这个是调试code代码时的内容宽度
     <input type='hidden' name='char_count' value='-1' id='EDiaryEditorStrLen'>\    </div>\
    <div style='width: 721px; height: 59px; background-image: url(images/editor/editor_foot.gif)'>\forasp.cn这里调节下标尺的宽度
    <div style='float: left; padding-top: 18px; margin-left: 18px; margin-top:16px;'><input type='checkbox' id='ModeCheck'><label for='ModeCheck'>显示源代码</label></div>\
上面代码时我将编辑器加宽100PX后的代码。

修改完毕以上内容,然后得修改图片的宽度,如果不修改图片宽度,则显示比较难看,修改的图片名称为editor_foot.gif

title_bg.gif guage.gif toolbar_bg.gif。图片整体内容不变,只是向右增加长度,但是要保存对应的空白


·上一篇:an error occurred while processing this directive >>    ·下一篇:Cannot use a scalar value as an array >>
推荐文章
最新文章