javascript – 用jQuery隐藏TinyMCE

前端之家收集整理的这篇文章主要介绍了javascript – 用jQuery隐藏TinyMCE前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在#container里面有一个TinyMCE textarea

当我使用$(‘#container’).hide()然后$(‘#container’).show(),tinyMCE throws:

Cannot read property ‘selection’ of undefined

我正在使用jquery插件,所以这就是我设置它的方式:

$('#container textarea').tinymce({ /* options */ });

我应该做些什么不同的事情?

解决方法

这里使用的正确命令是
// editor_id is the id of your textarea and 
// tinymce will use this id to uniquely identify this editor instance
editor_id = $("#container textarea").attr('id');
tinymce.get(editor_id).hide();

让它再次可见使用

tinymce.get(editor_id).show();
原文链接:https://www.f2er.com/jquery/159435.html

猜你在找的jQuery相关文章