Question

I want to create TinyMCE editor on the page, but it should boot and render only after focus on action. How can I do that, please, can you give advice to me.


Recession

Page may have include scores TinyMCE elements, and page will hang. Therefore, the field should be converted into TinyMCE as needed, initially it's just textarea.

Était-ce utile?

La solution

The first example in the documentation shows how you can toggle the editor on and off in Javascript. Just attach an onclick handler to your <textarea> that turns the editor on. Here's some jQuery-based code that I haven't tested, but should work...

$("textarea").click(function() {
    if (!tinyMCE.get(this.id)) {
        tinyMCE.execCommand('mceAddControl', false, this.id);
    }
 });

Autres conseils

At the manufacturer's site is all there, thanks for the tip-off Dean Harding.

http://tinymce.moxiecode.com/examples/example_12.php

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top