Here is the code for the iframe:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe width="0" scrolling="no" height="0" frameborder="0" class="iballoonstyle" id="iframetop"> | |
</iframe> |
Little bit of CSS to go with it:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.iballoonstyle | |
{ | |
position: absolute; | |
z-index: 1; | |
display: none; | |
} |
And here is the code that you can invoke when you hide/show the dynamic element:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code for show where 'dynamic' is the id of the dynamic element | |
// and 'iframetop' is an iframe element | |
// Little bit of prototype in there as well | |
if(document.all) { | |
var layer = $('dynamic'); | |
layer.style.display = 'block'; | |
var iframe = $('iframetop'); | |
if(iframe) { | |
iframe.style.display = 'block'; | |
iframe.style.width = layer.offsetWidth-5; | |
iframe.style.height = layer.offsetHeight-5; | |
iframe.style.left = layer.offsetLeft; | |
iframe.style.top = layer.offsetTop; | |
} | |
} | |
// Code for hide | |
if(document.all) { | |
var layer = $('dynamic'); | |
var iframe = $('iframetop'); | |
if(iframe) { | |
iframe.style.display = 'none'; | |
iframe.style.width = 0; | |
iframe.style.height = 0; | |
} | |
} |
This has made my day more than a couple of times.