I wanted to do something like WordPress editor.
I took jQuery UI tabs (I don’t want to use another tabs plugin, becauase I already use jUI for tabs on the site) and created two tabs named like “WYSIWYG” and “HTML”. There’s a TEXTAREA under the tabs header.
Then I wanted to use NicEdit – as you can see in the demo, it can “wrap” and “unwrap” textarea with HTML editor. Everything seemed fine, but the problem is:
- when I use “” or “#” in tabs’ HREF, the first tab is active, the second is not – so is not clickable, so I cannot attach SELECT event to it
- when I use non-existing id (
<a href="#notexist">...), it of course throws exception - when I use non-existing, “dummy” selector (really –
<a href="dummy">...) then under the tabs header (between tabs and textarea) appears quite big space, like tabs created new div and “closed” it as their content.
All I want is to use jQuery UI tabs just to create two tabs without content, which can be (de)selected and fire events when selecting, so I could use NicEdit. What am I missing?
I’m not sure I understand completely what is your problem. I’ve guessed you are trying to use only one textarea. Correct me if I’m wrong.
Anyway, I think you’re better off using two textareas and synchronize them when switching tabs.
NicEdit provides a basic javascript API to get/set the content of editor instances.
I have made jsfiddle for you to see.