Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fade text when page scrolls

Tags:

jquery

fadeout

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 tranisiton?

Like this site:

http://themetrust.com/demos/hero/

Many thanks

like image 371
Bomber Avatar asked May 22 '26 03:05

Bomber


1 Answers

use this

var divs = $('.social, .title');
$(window).scroll(function(){
   if($(window).scrollTop()<10){
         divs.stop(true,true).fadeIn("fast");
   } else {
         divs.stop(true,true).fadeOut("fast");
   }
});

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!