Ah right, I neglected to consider that part of your problem. One solution I can think of is to manually define a DIV that's outside your scrolling DIV at the bottom of your page's source, for example:
Code:
<div id="actualcontent" style="position:absolute; border: 1px solid blue; background-color: white; width: 300px; padding: 4px; display:none; z-index:100;">
</body>
Then, modify the script to grab the HTML contained inside the original DIVs, and display it inside the DIV we just added instead. To do this, change the original script to the following version instead:
Code:
<script type="text/javascript">
/***********************************************
* Drop Down/ Overlapping Content- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobjcontent=document.getElementById(subobjstr).innerHTML
var subobj=document.getElementById("actualcontent")
subobj.innerHTML=subobjcontent
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0)
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0)
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
return false
}
else
return true
}
function overlayclose(subobj){
document.getElementById("actualcontent").style.display="none"
}
</script>
I did a quick test in IE and Firefox, and it seems to work.
Bookmarks