Overlay divs on scroll

前端 未结 3 439
日久生厌
日久生厌 2020-12-29 16:58

Instead of scrolling down the page to view a bunch of divs, I would like them to overlay in the same place-- one stacked on top the next -- when you scroll. So, you would sc

3条回答
  •  佛祖请我去吃肉
    2020-12-29 17:30

    Here is a proof of concept that, whilst works, does need to be tested across browsers (however I'm confident that it will work everywhere) and slightly refined.

    The idea is to use JavaScript to monitor the window's scroll position and fix the appropriate content panel accordingly, giving the illusion that the new content is overlapping it when scrolling in to view.

    http://jsfiddle.net/amustill/wQQEM/

提交回复
热议问题