Show Div when scroll position

前端 未结 3 1709
野性不改
野性不改 2020-11-27 11:42

First of all i would like to refer to this website: http://annasafroncik.it/ I love the way the animations come into view. Is it hard to create a similar function in jquery?

3条回答
  •  迷失自我
    2020-11-27 12:33

    Plugins? Maybe, but you could definitely build any animation combinations you could imagine with jQuery by yourself. If you have a firm grasp on selectors and CSS, the sky's the limit! I'd suggest starting on the jQuery website and checking out some examples.

    To help get the ball rolling, and maybe give you some ideas if you're already familiar with jQuery, you could try the following...figure out how far down the page your div is, listen for scroll events, and when the div comes into focus (i.e.: the page has been scrolled past the div's position you worked out), run an animation. Something like:

    Some content

    I hope I haven't messed up my syntax!

提交回复
热议问题