You'll want to find a dynamic way to reposition the drop down DIV based on the additional offsets of the DIV it's contained in. For example, lets say your drop down DIV is inside the DIV in red below:
Code:
<div id="test" style="position:relative; left:100px; top:50px">
<p>Demo #1: <a href="http://www.dynamicdrive.com" id="searchlink" rel="subcontent">Search DD</a></p>
<DIV id="subcontent" style="position:absolute; visibility: hidden; border: 9px solid orange; background-color: white; width: 300px; padding: 8px;">
<p><b>Search Dynamic Drive:</b></p>
<form method="get" action="http://search.freefind.com/find.html" id="topform">
<input name="query" maxlength="255" style="width: 150px" id="topsearchbox" alt="Search" />
<input value="Search" class="topformbutton" type="submit" />
</form>
<div align="right"><a href="javascript:dropdowncontent.hidediv('subcontent')">Hide this DIV manually</a> | <a href="http://www.dynamicdrive.com">Dynamic Drive</a></div>
</DIV>
</div>
If you try the above out, you'll notice how the DIV is positioned incorrectly as a result, namely, 100px to the right and 50px down where it should be. Normally the solution is just to move the drop down DIV outside the DIV in red, but since you can't do that, you'll need to tell the script to take into account the additional offset. Inside the .js file for example:
Code:
subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + 100 + horizontaloffset + "px"
subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+50+verticaloffset+"px"
That's the general idea anyway.
Bookmarks