Advertisement
Guest User

Untitled

a guest
Mar 26th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. jQuery(document).ready(function(){
  2.  
  3. if (jQuery(window).width() > 1350) {
  4.  
  5. //Check to see if the window is top if not then display button
  6. jQuery(window).scroll(function(){
  7. if ((jQuery(this).scrollTop() > 500)&&(jQuery(this).scrollTop() < height-230)) {
  8. jQuery('.scrollToTop').fadeIn();
  9. } else {
  10. jQuery('.scrollToTop').fadeOut();
  11. }
  12. });
  13.  
  14. //Click event to scroll to top
  15. jQuery('.scrollToTop').click(function(){
  16. jQuery('html, body').stop().animate({scrollTop : 0},800);
  17. return false;
  18. });
  19.  
  20. } else ((jQuery(window).width() < 940)&&(jQuery(window).width() > 140)) {
  21.  
  22.  
  23. //Check to see if the window is top if not then display button
  24. jQuery(window).scroll(function(){
  25. if ((jQuery(this).scrollTop() > 500)&&(jQuery(this).scrollTop() < height-230)) {
  26. jQuery('.scrollToTop').fadeIn();
  27. } else {
  28. jQuery('.scrollToTop').fadeOut();
  29. }
  30. });
  31.  
  32. //Click event to scroll to top
  33. jQuery('.scrollToTop').click(function(){
  34. jQuery('html, body').stop().animate({scrollTop : 0},800);
  35. return false;
  36. });
  37.  
  38.  
  39. }
  40.  
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement