Support for multiple responsive iframes on one page. #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added support for multiple iframes on one page by passing the href as well as the height to the parent window in postMessage, and then only resizing the iframe with the matching src attribute. I have tested it with cross-domain frames in IE8+, Chrome, Safari, and Firefox.
It seems the existing fallback method was setting the hash in the frame window and then checking it in the parent window. It is now setting it in the frame and checking each iframe for its content window hash. Still doesn't work across domains, but I have added a catch so it won't error. This is still only applied to IE7 and other browsers where postMessage is not supported.
Lastly, I cleaned up the files to pass as much of jslint as possible.