How can I monitor scroll position while scrolling in Safari on iOS?

前端 未结 6 1125
梦毁少年i
梦毁少年i 2021-02-05 03:58

I currently use $(window).bind(\'scroll\', foo); to monitor $(window).scrollTop() and do stuff to create a parallax effect.

In all desktop brow

6条回答
  •  一向
    一向 (楼主)
    2021-02-05 04:29

    I highly recommend using the "Skrollr" javascript library. It is by far the best mobile scrolling animation option that I've found to date and is very easy to get up and running quickly. Create animations and manipulate CSS based on a start and end scroll position. Create as many data scroll positions and animations as you need for most standard CSS properties.

    In the following example the background color would animate over the course of a 500 pixel scroll:

    WOOOT

    Checkout the repository on Git: https://github.com/Prinzhorn/skrollr

    Skrollr Demo Example: http://prinzhorn.github.io/skrollr/

    Awesome real world example: http://www.fontwalk.de/03/

提交回复
热议问题