Home › Forums › Feature Requests › Set WYSIWYG Height › Reply To: Set WYSIWYG Height
This is how Ive handled fitting wysiwyg editors height to its content, with a fallback to a min height.
if ( typeof acf !== 'undefined' ) {
acf.add_action( 'wysiwyg_tinymce_init', function( ed, id, mceInit, $field ) {
// set height of wysiwyg on frontend
var minHeight = 200;
var mceHeight = $( ed.iframeElement ).contents().find( 'html' ).height() || minHeight;
if ( mceHeight < minHeight ) {
mceHeight = minHeight;
}
$( ed.iframeElement ).css( 'height', mceHeight );
} );
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.