• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DIV Popup Location

 
Steve Dyke
Ranch Hand
Posts: 1644
1
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 1644
1
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 1644
1
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic