View Single Post
  #4 (permalink)  
Old 11-03-2005, 02:59 PM
RedMark RedMark is offline
WebProWorld New Member
 
Join Date: Nov 2005
Location: Newport Beach, CA
Posts: 16
RedMark RepRank 0
Default

I've done this on several sites. (check out www.mdmm.com). Put a graphic in the table (a 1 pixel transparent gif works fine, or use the graphic that belongs there) and name it finder.

Then use the following function to find the position of that graphic

var itm=findObj("finder")
leftset = itm.offsetLeft;
while((itm = itm.offsetParent) != null) leftset += itm.offsetLeft;
itm=findObj("finder");
topset = itm.offsetTop;
while((itm = itm.offsetParent) != null) topset += itm.offsetTop;
itm=findObj("divText")
itm.style.left=leftset-3
itm.style.top=topset
itm.style.visibility='visible'

the function findObj is a variation on a theme...

function findObj(n, d) {
var i,x;
if(!d) d=document;
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if (!x && d.getElementById) x=d.getElementById(n); return x;
}

The affect of this is you get the position of your "finder" graphic and position your menu accordingly, but I think Adam is absolutely right. To do this effectively, you're going to have to get into some hand-coding.
__________________
"I did not arrive at my understanding of the physical universe through my rational mind" -- Albert Einstein
Reply With Quote