Guest User

Untitled

a guest
Sep 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $(document).ready(function(){
  2. var _window = $(window);
  3.  
  4.  
  5. // smooth scrolling
  6. $("#menu").on("click","a", function (event) {
  7. event.preventDefault();
  8. var id = $(this).attr('href'),
  9. top = $(id).offset().top;
  10. $('body,html').animate({scrollTop: top}, 1500);
  11. });
  12.  
  13. //arrow up from bottom right side
  14. _window.scroll(function() {
  15. if ($(this).scrollTop() > 112) $(".btn_up").fadeIn("slow");
  16. else $(".btn_up").fadeOut("slow");
  17. });
  18.  
  19. $(".btn_up").on("click", function() {
  20. $("body, html").animate({
  21. scrollTop: 0
  22. }, 1000);
  23. });
  24.  
  25.  
  26.  
  27.  
  28. });
Add Comment
Please, Sign In to add comment