0

I need to hide and show the editor based on event.

I initiate the editor. then, i try to hide using the code:

$('#textare').hide();

but it doesn't work, since it as I think initiate iframe

so how can I show and hide editor

Update: I'm sorry forget to add editor name.. I use wysihtml5. I think the way that editor work is hide the textarea and make iframe so the above text couldent hide the editor.

assaqqaf
  • 1,575
  • 4
  • 21
  • 38

1 Answers1

2

The textarea should already be hidden since it will only be used as a fallback. The editor itself is contained in an iframe with class wysihtml5-sandbox. So this should toggle the editor

$(".wysihtml5-sandbox").hide()
Andreas
  • 21,535
  • 7
  • 47
  • 56
  • you get the idea, but still two problem: the toolbar didn't hide, the next i have multiple editor on same page. – assaqqaf Oct 22 '12 at 11:28
  • I won't do all the work for you. The toolbar is just another item (class `wysihtml5-editor-toolbar`) to hide. Which editor to hide are also just some lines of code which has nothing to do with this specific problem :) – Andreas Oct 22 '12 at 11:36
  • thanks. What make me confuse the iframe genrated by plug-in, but know I get the idea. but really the solution for multiple instance is not clear, since i couldn't find any ID or something.... – assaqqaf Oct 22 '12 at 11:47