Doesn’t work with nested iframes
supermueller opened this issue · comments
Karsten Müller commented
If you have an iframe in an document wicht itself is embedded in an iframe the script fails. The solution is to post the message to the parent window (and not to the top window):
ResponsiveIframe.prototype.messageParent = function(scrollTop) {
var h = document.body.offsetHeight;
h = (scrollTop)? h+'s':h;
if(parent.postMessage){
parent.postMessage( h , '*');
} else {
window.location.hash = 'h'+h;
}
};
Irakli Nadareishvili commented
Please post a pull request with the solution.
Thanks
Karsten Müller commented
I have post a pull request for the first time so I hope I have done it all right.
Irakli Nadareishvili commented
Done. Thanks!
Karsten Müller commented
It's been a pleasure.