I am trying to use Ben Almans jquery postmessage to resize an iFrame. I more or less use his example with different servers and dynamic content.
I also posted a question on this site, but it may actually be too new.
I have a job sending messages as a cross domain, but resizing just doesn't work. I'm just retelling what I wrote as Toby here:
I can not get iFrame to resize sequentially in browsers. Is this a touch you've come across? I added a timestamp to know when each function is called, and its rather strange ...:
- Firefox works fine - the child page starts up to the parent page.
- Chrome 7 will expand, not shrink. Timestamp = child to parent
- IE 8 ... the parent runs to the child ...! and the iframe is incremented by 30, each click on the links.
Does anyone have any experience?
Adding two pages for link to code:
Parent
<html> <head> <script language="javascript" src="jquery-1.4.2.min.js" type="text/javascript"></script> <script language="javascript" src="jquery.ba-postmessage.js" type="text/javascript"></script> <script> $(function(){ </script> </head> <body style="background-color:orange"> <div id="nav"></div> <div id="test"> <div id="zshop" style="border: 3px solid red"></div> </div> dette er slutten </body>
Child
<html> <head> <script language="javascript" src="jquery-1.4.2.min.js" type="text/javascript"></script> <script language="javascript" src="jquery.ba-postmessage.js" type="text/javascript"></script> <script> $(function(){ </script> </head> <body style="background-color:white;border: 3px solid black"> <div id="nav"></div> <div id="toggle"> nå fra oslsvr03 <div style="height:200px; background-color:blue;"></div> </div> <div id="stor" style="height:800px; background-color:orange; display: none">Denne skal ikke vises hele tiden!!!</div> </body>
source share