使用jQuery隐藏TinyMCE [英] Hiding TinyMCE with jQuery

查看:111
本文介绍了使用jQuery隐藏TinyMCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个TinyMCE textarea #container

I have a TinyMCE textarea inside of #container

当我使用 $时('#container')。hide()然后 $('#container')。show(),tinyMCE抛出:

When I use $('#container').hide() and then $('#container').show(), tinyMCE throws:


无法读取未定义的属性'选择'

Cannot read property 'selection' of undefined

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

I'm using the jquery plugin, so this is how I set it up:

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

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

What should I be doing differently?

推荐答案

这里使用的正确命令是

// 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();

这篇关于使用jQuery隐藏TinyMCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆