kindeditor 文本编辑器怎么获得焦点
1个回答
展开全部
用afterFocus类,例如:
<script charset="utf-8" src="/editor/kindeditor.js"></script>
<script charset="utf-8" src="/editor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#Neir', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
afterFocus : function(){
self.edit = edit = this;if(self.edit.html()=="<span style=\"color:#808080;\">回复内容字数不少于10字。</span>"){self.edit.html("") ;}
},
afterBlur : function(){
self.edit = edit = this;if(self.edit.html()==""){self.edit.html("<span style=\"color:#808080;\">回复内容字数不少于10字。</span>") ;}
},
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>
<script charset="utf-8" src="/editor/kindeditor.js"></script>
<script charset="utf-8" src="/editor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('#Neir', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
afterFocus : function(){
self.edit = edit = this;if(self.edit.html()=="<span style=\"color:#808080;\">回复内容字数不少于10字。</span>"){self.edit.html("") ;}
},
afterBlur : function(){
self.edit = edit = this;if(self.edit.html()==""){self.edit.html("<span style=\"color:#808080;\">回复内容字数不少于10字。</span>") ;}
},
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询