TinyMCE font size without scrollers fixed?

At the moment I have this:

tinyMCE.init({ // General options mode : "exact", elements : "fkField, lkField, ukcField, khField", theme : "advanced", plugins : "table", width : "300", height: "185", // Theme options theme_advanced_buttons1 : "fontsizeselect, bold,italic,underline,bullist, cleanup, |,justifyleft,justifycenter,justifyright", theme_advanced_buttons2 : "tablecontrols", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "bottom", theme_advanced_toolbar_align : "center", theme_advanced_resizing : false }); 

This gives me a 300x185 sized editor.

Now in this editor I would like to do this, you can only write until the editor is full. (without scroller)

Thus, you cannot enter more text, and the scroller should not appear (disable scrolling)

At the moment, you can simply create a new line at the bottom of the editor, and it will add a scroller <- which I do not want to do

How can i do this? Is it really impossible? I did some research for some time, but maybe it was just that I was looking wrong.

thanks

+4
source share
4 answers

You will need to write your own plugin. Check the height of the editor on every keystroke (you can use the tinymce onKeyUp built-in event). If changes in the initial state delete the last inserted code.

EDIT: How to get the current iframe heigth editor

  var currentfr=document.getElementById(editor.id + '_ifr'); if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax currentfr.height = currentfr.contentDocument.body.offsetHeight + 26; } else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax currentfr.height = currentfr.Document.body.scrollHeight; } 
0
source

add the following code to the ccs file

 .mceContentBody{ overflow-y:hidden!important; } 

and add the path to the css file in the content_css tinymce attribute

 content_css : /path/to/css/file.ss 
+1
source

I got it to work by adding it to my tinyMCE CSS extra file:

 IFRAME {overflow:hidden;} 

Previously, scrollbars were disabled only in Firefox. This also fixes Chrome. However, it adds a gray bar to the side of the scroll bar at the bottom, so I need to increase the height of the text editor.

0
source

for me it worked, just adding the rules to the regular stylesheet, there was no need to add the css file to the content_css attribute (the example is in scss)

 .my-tinymce-container { width: 200px; .mce-edit-area { height: 200px; overflow-y: hidden; } } 
0
source

All Articles