Menu positions 
Author Message
 Menu positions

I have written some JScript to pop-up multi-level menus using div
layers. It all works very nicely except for one irritation. If the
browser window is scrolled the menus appear in the wrong place. I
position my menus using:

Rect = document.all['MenuItem' + n].getBoundingClientRect();
document.all['TopLevel' + n] = Rect.bottom;
document.all['TopLevel' + n].style.visibility="visible";
document.all['TopLevel' + n].zIndex = 1;

It seems that the rect returned from getBoundingClientRect and the top
assigned to TopLevel'n' are only using equivalent coords if the
document is not scrolled. When it scrolls the menu is placed much
higher up. My 'guess' is that one is using document coords and one
screen, but I cannot fiogure out the relationship.

Any suggestions?

Robert Chafer
Silverfrost Limited.   http://www.*-*-*.com/
Home to Solar Kingdom, the 3D Solar System Simulator

Tue, 07 Sep 2004 16:01:34 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Positioning my dynamic menu with layers

2. menus and sub-menus and sub-sub-menus

3. Getting position of a relatively-positioned object

4. Mouseover menus, & ms menus

5. Sub Menu - Child Menu

6. Slow Menu load on ASPX page (menu as control)

7. File Position?

8. Capturing the Mouse position OnClick

9. Q: textbox - focus - cursor position

10. saving list position-please help

11. Position available for Postscript engineer

12. Need help adjusting image positioning on LaserJet 5000 in PostScript


Powered by phpBB® Forum Software