ACF - dynamic height for the wysiwyg editor

by Game Unity   Last Updated January 04, 2017 08:03 AM

I'm stucking a litle bit with the ACF wysiwyg editor. The problem is I want a dynamic front-end edit screen with ACF. Unfortunately the wysiwyg editor doesn't adjust its height based on its content height (like a normal div with text). I've tried this code on the generated iframe, but it didn't help:

// Source header.php

<script>
function setHeight(jq_in){
jq_in.each(function(index, elem){
    // This line will work with pure Javascript (taken from NicB's answer):
    elem.style.height = elem.scrollHeight+'px'; 
});
}
setHeight($('#acf-editor-586a728311895_ifr'));
</script>


Related Questions



ACF WYSIWYG Custom toolbar by key field

Updated September 21, 2017 10:08 AM