Changeset 1511002
- Timestamp:
- 10/09/2016 12:13:35 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
responsive-thickbox/trunk/includes/utility-functions.php
r1510354 r1511002 52 52 <div id="product-list-wrap" style="width: 100%; height: 100%; display: inline-block; background-color: white; border: 1px solid #ccc;" ></div> 53 53 <script> 54 function receiveMessage() 55 { 56 if (event.origin !== "https://www.wproute.com") 57 return; 58 59 // The data should be the outerheight of the iframe 60 var height = event.data + 0; 61 62 var iframe = jQuery('#product-list-frame'); 63 // Set a minimum height on the outer table but only if its not already there 64 var table = iframe.parents('table'); 65 if ( table.height() > height + 30 ) return; 66 table.css( 'min-height', ( height + 30 ) + 'px' ); 67 } 68 window.addEventListener("message", receiveMessage, false); 69 54 70 function iframeLoad(e) 55 71 { 56 72 var iframe = jQuery('#product-list-frame'); 57 // Set a minimum height on the outer table 58 var table = iframe.parents('table'); 59 var height = jQuery(iframe[0].contentDocument.body).height(); 60 table.css( 'min-height', ( height + 30 ) + 'px' ); 73 iframe[0].contentWindow.postMessage( "height", "https://www.wproute.com/" ); 61 74 62 75 // This is only for IE
Note: See TracChangeset
for help on using the changeset viewer.