Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. $(document).ready(function(){
  2.     $(window).scroll(function(){
  3.         // sticky navbar on scroll script
  4.         if(this.scrollY > 20){
  5.             $('.navbar').addClass("sticky");
  6.         }else{
  7.             $('.navbar').removeClass("sticky");
  8.         }
  9.        
  10.         // scroll-up button show/hide script
  11.         if(this.scrollY > 500){
  12.             $('.scroll-up-btn').addClass("show");
  13.         }else{
  14.             $('.scroll-up-btn').removeClass("show");
  15.         }
  16.     });
  17.  
  18.     // slide-up script
  19.     $('.scroll-up-btn').click(function(){
  20.         $('html').animate({scrollTop: 0});
  21.         // removing smooth scroll on slide-up button click
  22.         $('html').css("scrollBehavior", "auto");
  23.     });
  24.  
  25.     $('.navbar .menu li a').click(function(){
  26.         // applying again smooth scroll on menu items click
  27.         $('html').css("scrollBehavior", "smooth");
  28.     });
  29.  
  30.     // toggle menu/navbar script
  31.     $('.menu-btn').click(function(){
  32.         $('.navbar .menu').toggleClass("active");
  33.         $('.menu-btn i').toggleClass("active");
  34.     });
  35.  
  36. });