aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes How to Know Where Cursor is Positioned Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to Know Where Cursor is Positioned" Watch "How to Know Where Cursor is Positioned" New topic

How to Know Where Cursor is Positioned

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1519
I have a page with two DIV tags on it(and upper section and lower section). I place a jsp in the lower section using jQuery load. When in the lower section I use the following code to keep up with the cursor so when mousedown is detected a third DIV tag is displayed at that point. This all works good except I tried to make the lower section DIV tag scrollable using overflow. Now my third DIV tag does not display at the cursor position it is offset usually lower. I figure it is the scrolling offset of the lower DIV tag but I have no idea how to compensate for this.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15383
Are you putting the div inside of the layer that scrolls and not on the document level?

The div also has a scrollTop

I agree. Here's the link:
subject: How to Know Where Cursor is Positioned