Trigger event when user scroll to specific element - with jQuery

后端 未结 12 1448
攒了一身酷
攒了一身酷 2020-11-22 11:52

I have an h1 that is far down a page..

TRIGGER EVENT WHEN SCROLLED TO.

and I want to trigger an alert

12条回答
  •  执念已碎
    2020-11-22 12:30

    If you are doing a lot of functionality based on scroll position, Scroll magic (http://scrollmagic.io/) is built entirely for this purpose.

    It makes it easy to trigger JS based on when the user reaches certain elements when scrolling. It also integrates with the GSAP animation engine (https://greensock.com/) which is great for parallax scrolling websites

提交回复
热议问题