npr/responsiveiframe — pull request #21 by sarahgoldman (2013-09-26 19:14:09+00:00)
Title: Support for multiple responsive iframes on one page.

I closed my original pull request (#20) and am submitting this one because I fixed the navigating to new pages within frame issue I mentioned in the original pull request.

Now instead of passing the frame window's href in the postMessage and matching iframes based on src, I am passing the window name and matching iframe name attributes.

Note that this is not backwards compatible to existing markup in the sense that all responsive iframes need to have a unique name attribute. Existing markup won't break, it just won't match and resize.

If you wanted to support iframes without name attributes, I guess you could fall back to passing the href and then matching iframe srcs if an href is received instead of a name. But I didn't write that fallback yet in since I'm just going to put unique names on all my iframes.