wood burning stoves
The moose likes HTML, CSS and JavaScript and the fly likes Mouse Positioning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Mouse Positioning" Watch "Mouse Positioning" New topic

Mouse Positioning

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
Heres the situation: I have a table with 1 row and 5 columns. Each cell is going to act as a parent menu option. When I move the mouse over each cell there will be a menu showing up underneath the appropriate parent option. On the Adobe website is a good example of what I'm trying to do (i.e. the dropdown menus). I have each sub-menu created as tables that are surrounded by DIV tags, I then set the visibility to be true when the mouseover event occurs.

What I want to know is : how do you determine the mouse position on a mouseover? Since I'm using percentages is there a way of determining the position of a cell when re-sizing (i.e. the parent cells in this case) so that I can then set the position of the sub-menu accordingly if the window gets resized? On initializing the window I use stylesheets for the submenus' DIV tags (i.e. basically visibility: hidden but this doesn't seem to work in Netscape 4.X). I know this is an older browser but some customers still use this browser (corporations aren't quick on implementing such things as new broswers so I would like to handle 4.X browsers as much as possible). If someone could answer these questions could you try and keep in mind I'm trying to support as many versions of IE and Netscape as possible. Thanks so much.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
With showing and hiding with Netscape 4.X you are going to go through hell since it requires a lot more pain in the butt stuff to do.

This code might help you in finding the position:


Showing and Hiding layers

I agree. Here's the link: http://aspose.com/file-tools
subject: Mouse Positioning
jQuery in Action, 3rd edition