主题: 在tab切换下,无法加载编辑器 |
作者: Victor, 发布日期: 2013-10-28 09:45:44, 浏览数: 2357 |
如下为页面的代码:
<script charset="utf-8" src="../kindeditor/kindeditor-min.js"></script> <script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script> <script> var editor; KindEditor.ready(function(K) { editor = K.create('textarea[name="content"]',{ filterMode: false, resizeType : 1, cssPath : '../kindeditor/plugins/code/prettify.css', uploadJson : '../kindeditor/asp/upload_json.asp', fileManagerJson : '../kindeditor/asp/file_manager_json.asp', allowPreviewEmoticons : true, allowImageUpload : true, allowFileManager : true, items : [ 'source','preview','fullscreen','|','fontname', 'fontsize', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'table','insertorderedlist','insertunorderedlist', 'subscript','superscript','|','image','flash', 'media','insertfile','baidumap', 'link', 'unlink','anchor'], afterCreate : function() { var self = this; K.ctrl(document, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); K.ctrl(self.edit.doc, 13, function() { self.sync(); K('form[name=myform]')[0].submit(); }); },afterBlur: function(){this.sync();} }); prettyPrint(); }); </script> <script> function setTab(m,n){ var tli=document.getElementById("menu"+m).getElementsByTagName("li"); var mli=document.getElementById("main"+m).getElementsByTagName("div"); for(i=0;i<tli.length;i++){ tli[i].className=i==n?"hover":""; mli[i].style.display=i==n?"block":"none"; } } </script> <div id="tabs0"> <ul class="menu0" id="menu0"> <li onclick="setTab(0,0)" class="hover">基本信息</li> </ul> <div class="main" id="main0"> <div class="block"> <table> <tr> <td align="right" width="10%">产品详细描述:</td> <td align="left"><textarea name="content" style="width:100%;height:300px;visibility:hidden;"></textarea></td> </tr> </table> </div> </div> </div>请高手帮忙指点,在此十分感谢!
|