Question:
How to maintain window scroll position after closing popup div panel?
Jai-sama
2011-06-18 16:16:52 UTC
I am building a single-page gallery website that has horizontal scrolling. The style has a width of 5000px, so it's the whole page that is being scrolled, not a
. By clicking on thumbnails on the page, a piece of javascript unhides a
to make it appear in front of everything else, similar to a lightbox. It's a pretty simple script that just changes the
from display: none to display: block. Clicking the
's close button toggles the
back to display: none. The problem arises when I scroll my browser window to the right to click one of the buttons in that section of the page. The
pops up without any trouble, but when I click the close button, instead of maintaining the Y coordinates of the page, the browser scroll bar returns to the default position at the far left. There is no reload or refresh taking place, so A: How is this possible? and B: What sort of script do I need to convince my page to stay where I scrolled it to?
Three answers:
Nik
2011-06-18 17:32:13 UTC
I think I get your problem mine was I had a long page and after a user clicked a link for an image to pop up at the bottom it would jump to the top of the page. If that is similar to your problem You might want to look into returning a false.



http://www.codingforums.com/archive/index.php/t-123390.html
vanburen
2016-12-18 08:29:14 UTC
Div Scroll Position
disilvestro
2016-11-11 03:19:09 UTC
in case you shut the window against the wind...you stunt advance and progression. Wind is symbolic of substitute. The wind "blows out" the previous stagnant factors in our life and "blows in" new seeds to be planted and harvested in and with the aid of our life.. Wind constantly brings substitute in one form or yet another. that's how we receive the wind that makes the version in our lives. Is the window open to a minimum of something new and distinctive, no remember how "huge gust and flying debris" could be or can we close the window and sweetness what could have been.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...