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.
Place element at top of viewport
Moderator: General Moderators
Place element at top of viewport
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Yep, exactly. I hadn't noticed it always shows up in the viewport.
For posterity's sake, the solution was:
Thanks.
For posterity's sake, the solution was:
Code: Select all
window.pageYOffsetReal programmers don't comment their code. If it was hard to write, it should be hard to understand.