Viewing File: /home/ubuntu/codegama-ui-revamp/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).on('mouseenter', '[data-bs-toggle="tab"]', function () {
$(this).tab('show');
});
$(document).ready(function () {
$("#header").load("header.html");
$("#footer").load("footer.html");
$("#contact").load("contact.html");
});
// ===== Scroll to Top ====
$(window).scroll(function() {
if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px
$('#return-to-top').fadeIn(200); // Fade in the arrow
} else {
$('#return-to-top').fadeOut(200); // Else fade out the arrow
}
});
$('#return-to-top').click(function() { // When arrow is clicked
$('body,html').animate({
scrollTop: 0 // Scroll to top of body
}, 800);
});
$('html, body').animate({ scrollTop: 0 }, 'fast');
Back to Directory
File Manager