wordpressiframeheightsizing

iframe height issue within an accordian


I'm having an issue with an external iframe contained within an accordian on a WordPress website.

Here it is: https://nomoreply.co.uk/6mm-preprimed-tile-backing-boards/

Under the "Quantity Calculator" accordian.

On mobile view the iframe calculator contains alot of empty space at the bottom - I would like to remove this:

iframe sizing issue

I have tried various height settings both inline and within the iframe tag. Also an external javascript I found on stackoverflow. Nothing has worked.


Solution

  • I wrote a library called iframe-resizer, that you might want to look at. It uses multiple techniques to force an iframe to size to its content. It is a way harder problem than it should be.