Viewing File: /home/ubuntu/joystickhut-shop-landing/assets/js/script.js


// scroll responsive top nav

$(document).ready(function () {
  $(window).scroll(function () {
    if ($(document).scrollTop() > 50) {
      $(".header-nav-center").addClass("header-fixed");
    } else {
      $(".header-nav-center").removeClass("header-fixed");
    }
  });
});

/*------------- Smooth Click Scroll -------------*/

$('a.smooth[href^="#"]').on("click", function (event) {
  var target = $(this.getAttribute("href"));
  if (target.length) {
    event.preventDefault();
    $("html, body").stop().animate(
      {
        scrollTop: target.offset().top,
      },
      1000
    );
  }
});

$(document).ready(function () {
  $("#header").load("header.html");
  $("#footer").load("footer.html");
  $("#contact").load("contact.html");
  $("#faq").load("faq.html");
});
Back to Directory File Manager