Created
July 2, 2016 07:13
-
-
Save delowardev/50d33f939825b14fb134c21fe146eb8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).scroll(function(){ | |
if ($(this).scrollTop() > 150) { | |
$('.topScrl').fadeIn(); | |
} else { | |
$('.topScrl').fadeOut(); | |
} | |
}); | |
//Click event to scroll to top | |
$('.topScrl').click(function(){ | |
$('html, body').animate({scrollTop : 0},800); | |
return false; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment