Fade text when page scrolls

后端 未结 4 1274
Happy的楠姐
Happy的楠姐 2021-02-06 18:33

I have this basic example working:

http://www.mharrisweb.co.uk/tester.htm

Is there anyway I can get the fading text to scroll slightly, to create a more fluid tr

4条回答
  •  渐次进展
    2021-02-06 19:02

    Use this:

    http://api.jquery.com/animate/

    It allows you to smoothly move the element to a given coordinates, which you can determine using:

    http://api.jquery.com/scrollTop/

    Also you will need this:

    http://api.jquery.com/fadeTo/

    It allows you to fade to a particular transparency, instead of all the way to fully transparent. You will need this if you want it to look like the "themetrust.com" example you gave, if you notice if you only scroll a little, it only fades a little

提交回复
热议问题