Ashwini
Ashwini

Reputation: 2497

How to increase height of tinymce Iframe?

On my page there are 3 tinymce editor are there in different tabs. I want to increase the iframe height of specific tinymce.

and these editor are in modal box. When I click button then it opens different tabs.

I have included my content_css in tinymce.yml file

mode: "exact"
selector: "textarea.tinymce"
theme: "modern"
#encoding : "xml"
convert_urls: false
content_css: "/assets/my_tinymce.css"

I have added my css in this my_tinymce.css but it was not working.

Also added my jquery code on the same page to change the height using jquery but did not get any success.

jQuery(document).ready(function(){
    $("#iframe_id_of_selected_tinymce").css("height","300px");
});

please help.

Upvotes: 1

Views: 4957

Answers (2)

Ashwini
Ashwini

Reputation: 2497

Finally got the solution, add following lines on your page. which will create specific class for specific text area.

<script>
    tinyMCE.init({
        mode : "specific_textareas",
        editor_selector : "my_tinymce",
        height : "300px"
    });
</script>

and add this my_tinymce class to textarea you want.

<textarea rows="10" name="textarea" id="textarea" cols="180" class="my_tinymce" aria-hidden="true"></textarea>

Upvotes: 3

arun.m
arun.m

Reputation: 131

you can try:

$("#iframe_id_of_selected_tinymce").height(500);

i think the problem with your jquery code is the semi colon in "300px;", you don't need that

Upvotes: 1

Related Questions