npr / responsiveiframe

Responsive IFrames

Home Page:http://npr.github.com/responsiveiframe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not resizing for dynamic content

grahamharper opened this issue · comments

I'm trying to integrate your plugin but experiencing some issues.

Part of my child page content is loaded in after the initial load using jQuery but the parent iFrame doesn't seem to be resizing to fit it. I'm seeing this in Chrome and Firefox but it is resizing to show all content when I check it on Mobile Safari.

Also when a user interacts with this content it can change in height (showing and hiding elements with jQuery). On doing this I'm seeing inconsistent behaviour:

  • In Chrome/Firefox the parent iframe doesn't resize at all.
  • In Mobile Safari when the height of the content increases so does the iframe height, but when the content height then decreases the iframe height doesn't decrease with it. It just stays at the bigger size.

Any thoughts?

Do you have any other examples of your plugin being used with more dynamic content?

commented

I would need to see an example to understand more of whats happening. One thing for you to look into is making sure that you fire off a hight change message after your content changes dynamically. If the window does not resize, but your content hight changes you will have to handle sending that message. Our example is currently fired off of a resize event.

Hi johny,
Thanks for the tip, was just what I needed to go tinkering. I'm now just calling ir.messageParent(); whenever I manipulate content that affects the height and it seems to be working just fine.

Any ideas when you will get around to removing the dependency on jQuery for the parent script?

commented

I do have a version that doesn't require jQuery personally, but havent released it here. Would be interested to see if more people would like to see a polished version without jQuery.

John, I would like to :)

+++1 for the jquery free version ; )