This turns out to be easier than I thought. Just put another division around the HTML markup of the drop box and set its position:relative, ex:
HTML Code:
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div style="position:relative;left:100px;width:50%;">Hi!
<div id="dropinboxv2cover">
<div id="dropinboxv2">
INSERT YOUR CONTENT HERE. DO NOT REMOVE THE TWO OUTER DIVS
<br>
<p align="right"><a href="#" onClick="dismissboxv2();return false">Close It</a></p>
</div>
</div>
</div>
</body>
Notes: Setting this new outer containing division's width to less than 100% is necessary only if its left position isn't 0. It will be 0 if no left property is listed. I just included the left and width (and all those <br> things) to demonstrate that the drop down will follow the container wherever it goes. The style="position:relative;" is all that is required.
Added: For windows that might scroll vertically (almost all) this function must be changed in the script:
Code:
function dropinv2(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossbox.style.top)<0){
crossboxcover.style.top=scroll_top+dropboxtop+"px"
crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
}
else{
clearInterval(dropstart)
crossbox.style.top=0
}
}
Just get rid of the red part.
Bookmarks