• 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

DIV Popup Location

 
Ranch Hand
Posts: 2206
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use the suggestions I got from this forum concerning DIV tags. I have a main layout page in which I place some static DIV's to hold JSP's. I also have several DIV's I am using as popups to promt and or display specific info when a user clicks different links and form controls.

My question is what is the best way to position these popups in a particular location? I know how to set the x any y positions of the DIV but figuring out the values that x and y needs to be is my challenge. In my past windows development I placed an invisible control on the form where I desired then when positioning dynamic controls I would reference the top and left properties of the invisible control. Not sure how to do that on a web page.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you want to put it?

If you know the co-ords, then I'm not sure what the question is.

If you want it relative to a mouse event like a click, the location of the event is available in the Event instance.
 
Steve Dyke
Ranch Hand
Posts: 2206
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Where do you want to put it?

If you know the co-ords, then I'm not sure what the question is.

If you want it relative to a mouse event like a click, the location of the event is available in the Event instance.



In some cases I have the DIV poping up at the mouse location but this is not practical for ever case.

Say I have a text box that shows a drawing number it is in a JSP location in one of my statis DIV's. Now the user clicks on a link to show the release history of this drawing number. I would like the DIV to popup just under the textbox of the drawing number. Again I can set the x and y of the DIV but what is the best way to know where the co-ords of the drawing number text box is?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you a jQuery user? If so, use it.

If not, you will have a lot of fun trying to figure it out in a browser-independent fashion (in other words, not too easily).
 
Steve Dyke
Ranch Hand
Posts: 2206
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Are you a jQuery user? If so, use it.



How do I use jQuery to get the position of my static textbox location?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
offset()
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic