iframe-resizer
iframe-resizer copied to clipboard
height calculations differing for same content after dynamic change inside iframe
The resizer script seems to be working well, except my height calculations are not consistent when content is reduced. The content displayed inside our iframe is a simple directory search form that displays department results underneath using a javascript submitted form post. Depending on the search, this results list varies in height for each submission and needs to adjust accordingly. I can search for "Marketing" which gives me 20 results and the height calculation works (style="overflow: hidden; height: 4281px;"). I then search for "Technology" which has closer to 40 results and the height calculation properly increases (style="overflow: hidden; height: 7123px;"). If I then, however, search for "Marketing" again the height does not adjust back down to the original 4281px (style="overflow: hidden; height: 6938px;"), leaving a large white space under my iframe content.
I've checked for elements set to 100% height and am not seeing anything, and have tried various height calculation methods to no avail. Any insight for this?
Thanks
Try different height calculation methods. lowestElement and taggedElement normally work the best
I had this exact same issue with dynamic content and using taggedElement fixed it. However, I had to remove height: 100%
from it, otherwise it wouldn't work.
None of the other options worked.