[thelist] dom gives me a headache

rudy r937 at interlog.com
Fri Dec 14 14:17:08 CST 2001


trying to install webreference's hiermenus...

by default, they pop up relative to the mouse/cursor

i want them to pop up always in the same spot, underneath certain images

the images are defined

   <img name="foo" id="foo" src="foo.gif">
   <img name="bar" id="bar" src="bar.gif">

the hiermenus documentation (feh! if you can call it that!) simply says

   "You can create a function that finds the correct
   position each time the menu needs to be displayed."

so far, so good, but i cannot seem to write this function

what i want is to pass the function the image id or name (notice they are
cleverly the same) and get back the top and left coordinates

what i'm getting stuck on is javascript errors, and for the life of me i
cannot figure out the syntax -- and i've run out of ideas

for ie, which of the following is it?

   alert( document.all(foo).offsetLeft )
   alert( document.all('foo').offsetLeft )
   alert( document.all("foo").offsetLeft )
   alert( document.all[foo].offsetLeft )
   alert( document.all['foo'].offsetLeft )
   alert( document.all["foo"].offsetLeft )

these all give me errors -- what am i doing wrong?

for navigator i'm going to have to use something like

   document.images['foo'].x

right?


rudy





More information about the thelist mailing list