• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mouseover popup location

 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic