/ Published in: jQuery
This is a plugin that scrolls the page up slowly and fades out the clicked link. It's a plugin but I can't find the author. If you know who wrote it please leave a url in the comment section and I'll update
Expand |
Embed | Plain Text
//scroll to top................................... $(function(){ $.fn.scrollToTop=function(){ $(this).hide().removeAttr("href"); if($(window).scrollTop()!="0"){ $(this).fadeIn("slow") } var scrollDiv=$(this); $(window).scroll(function(){ if($(window).scrollTop()=="0"){ $(scrollDiv).fadeOut("slow") }else{ $(scrollDiv).fadeIn("slow") } }); $(this).click(function(){ $("html, body").animate({scrollTop:0},"slow") }) } }); $(function() {$("#toTop").scrollToTop();});
You need to login to post a comment.
