Place element at top of viewport
Posted: Mon Dec 17, 2007 12:47 pm
Hi all,
I've got a password change form inside an element that will appear when an icon is clicked. This form will be used on a page with a potentially long list, so the user might scroll down a bit first.
I've currently managed to get this form to appear at the top of the page - even if the top of the page is outside the current user's viewport. Is there a way - either with CSS or Javascript - to ensure the form will always appear inside what the user is currently looking at? I'm sure there's a window variable available to Javascript, but I can't find it anywhere.
Thanks for any & all help.
I've got a password change form inside an element that will appear when an icon is clicked. This form will be used on a page with a potentially long list, so the user might scroll down a bit first.
I've currently managed to get this form to appear at the top of the page - even if the top of the page is outside the current user's viewport. Is there a way - either with CSS or Javascript - to ensure the form will always appear inside what the user is currently looking at? I'm sure there's a window variable available to Javascript, but I can't find it anywhere.
Thanks for any & all help.