如何将nicedit设置为不可编辑 [英] how to set nicedit uneditable
本文介绍了如何将nicedit设置为不可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用nicedit js,它是我的textarea中的WYSIWYG编辑器,用于查看html文档,但仍可编辑,如何将nicedit设置为只读模式,我尝试从其文档中搜索但无法找到它,有没有人有使用nicedit的经验?
i'm using nicedit js which is is a WYSIWYG editor in my textarea to view html doc, but it still editable, how to set this nicedit to readonly mode, i try to search from its doc but unable to find it, do any one have experience using nicedit,
预先感谢
推荐答案
这是我与nicEdit一起使用的有用的jQuery解决方案:
Here is a helpful jQuery solution that I use with nic
jQuery('.nicEdit-main').attr('contenteditable','false');
jQuery('.nicEdit-panel').hide();
您只需将其更改回"true"即可使其再次可编辑.
You can simply change it back to 'true' to make it editable again.
注意:我会考虑与此解决方案一起切换div背景色.
Note: I would consider toggling the div background-color along with this solution.
这篇关于如何将nicedit设置为不可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文