File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mouseover popup location

 
Steven Bell
Ranch Hand
Posts: 1071
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with a mouseover popup box (div element not new window). It displays and hides properly and if I don't attempt to modify where it apears it appears to the bottom right of the mouse, however in some cases this puts it off the bottom of the screen. Because of the layout of the page it would be nice to 'simply' place the bottom right corner on the mouse instead of the top left. However if I attempt to set the top, left, bottom, or right of the style object (I hope that made sense) it puts the box far away in odd places and sometimes off the screen. I think part of the problem is that the section that has the mouseover is in a frame that scrolls. Scrolling also seems to have an effect as to where the box pops up.

This is the js function that creats the popup. As it is, with the commented sections left out, the box appears to the bottom right of the mouse curser.



Does anybody have any idea how to make the box popup where I want it?

Thanks ahead of time for the help.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wrote this real quick:




You need to adapt it to show and hide the box and maybe a lock to keep it in place.

hope this helps
Eric
[ January 31, 2005: Message edited by: Eric Pascarello ]
 
Steven Bell
Ranch Hand
Posts: 1071
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much!! That worked out great. I had to modify it a little, and I ended up sticking it all in one function, but here is the final code:



I used the getElementsByTagName because there are several of these popups in a dynamic table and I needed to get the right one. Other than that I don't think I changed much.

Here is the relevant css information.


Thank you again.

Now on the next iteration I'll probably have to size the popup window to fit the table in it.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may find out that you may need to replace the code



with



I think I goofed.
Eric
[ February 01, 2005: Message edited by: Eric Pascarello ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic