nprapps / pym.js

Resize an iframe responsively depending on the height of its content and the width of its container.
http://blog.apps.npr.org/pym.js/
MIT License
808 stars 114 forks source link

Multiple responsive iframes not getting height value till resize #55

Closed akanik closed 9 years ago

akanik commented 10 years ago

I'm using pym.js to display multiple iframes on a single page, each iframe is contained on a different tab of a javascript tab table (http://publicsource.org/pittsburgh-crime-statistics-2010-2013).

I'm running into issues on Firefox and Internet Explorer where the iframes on tabs 2 and 3 are not receiving a height until the iframe page is manually resized. Not working at all on Internet Explorer.

I'm pretty sure the issues is with how/where I'm calling the pym.js, but I was hoping you could give me a bit of help on this. Using Drupal 7.

Best, A

TylerFisher commented 10 years ago

Hey Alexandra,

We recently implemented custom iframe messaging in Pym that might help solve your problem. See the docs here, at the bottom under the section "Sending Custom iFrame Events".

Basically, when you could have a function that fires when a user clicks on one of the tabs. In that function, you send a message to the child.

The child listens for that message, and when it receives that message, the child can run a function that updates the height (by calling pymChild.sendHeight()).

TylerFisher commented 10 years ago

You can also take a look at our example files, which do almost exactly what I've outlined above. https://github.com/nprapps/pym.js/tree/master/examples/events

akanik commented 10 years ago

Thanks Tyler, I'll work on that. Messed around a bit already and still no go...

onyxfish commented 9 years ago

Closing this out since it isn't a bug in Pym.