Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function(){
- if (jQuery(window).width() > 1350) {
- //Check to see if the window is top if not then display button
- jQuery(window).scroll(function(){
- if ((jQuery(this).scrollTop() > 500)&&(jQuery(this).scrollTop() < height-230)) {
- jQuery('.scrollToTop').fadeIn();
- } else {
- jQuery('.scrollToTop').fadeOut();
- }
- });
- //Click event to scroll to top
- jQuery('.scrollToTop').click(function(){
- jQuery('html, body').stop().animate({scrollTop : 0},800);
- return false;
- });
- } else ((jQuery(window).width() < 940)&&(jQuery(window).width() > 140)) {
- //Check to see if the window is top if not then display button
- jQuery(window).scroll(function(){
- if ((jQuery(this).scrollTop() > 500)&&(jQuery(this).scrollTop() < height-230)) {
- jQuery('.scrollToTop').fadeIn();
- } else {
- jQuery('.scrollToTop').fadeOut();
- }
- });
- //Click event to scroll to top
- jQuery('.scrollToTop').click(function(){
- jQuery('html, body').stop().animate({scrollTop : 0},800);
- return false;
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement