• 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

How to set relative position for dialog box when scroll bars are activated?

 
Ranch Hand
Posts: 231
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

Have a web app which consists of a form and have it set up to launch a dialog box containing information next to the subject label text field.
Everytime, someone fills out the form and clicks on submit, the form's message body (from the text area of the form) is displayed on top and the
form is displayed underneath it. Before, I had it set up as fixed (x,y) for the dialog box to appear next to the subject label. But, now, when
the page becomes longer, the dialog box doesn't appear next to my subject label text field. It is displayed a lot lower.

Here's the code to find the position:



Here's the code that calls this function to display a dialog box at a specific place:



How can I set it so my findPosition() calculation doesn't miscalculate when the page is too long (when scroll bars are needed)?

Is there a way to set the relative positioning to always have the dialog appear 40px right of the subject label?

Thank you for taking the time to read this.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


scrollTop
scrollLeft

Eric
 
James Dekker
Ranch Hand
Posts: 231
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

Thank you very much for responding!

How would I use these in my findPosition() function?

scrollLeft and scrollTop?

 
He baked a muffin that stole my car! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic