| Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 Path : /home/u901718425/domains/kalpataruprimera.in/public_html/ |
| Current File : /home/u901718425/domains/kalpataruprimera.in/public_html/script.js |
$(document).ready(function () {
$('.nav-item').click(function(){
$('.navbar-collapse').removeClass('show');
});
$(document).on('click','.tabbed-floor-plans .floor-links li a',function(){
$('.tabbed-floor-plans .floor-links li a').removeClass('active');
$(this).addClass('active');
$('.tabbed-floor-plans .floor-details').removeClass('collapsed');
$('.tabbed-floor-plans #f'+this.id).addClass('collapsed');
});
let sectionIds = [];
$('.nav-item').each(function (index, element) {
sectionIds.push($(this).attr('href'));
});
// Initialize the current section as the first section
var currentSection = sectionIds[0];
console.log(sectionIds);
$(window).scroll(function() {
// Check which section is currently in the viewport
var scrolledSections = sectionIds.filter(function(sectionId) {
return $(sectionId).offset().top <= $(window).scrollTop() + 10;
});
// Update the current section to the last section in the viewport
currentSection = scrolledSections[scrolledSections.length - 1];
console.log(currentSection);
// Change the color of the navigation link for the current section
$('.nav-item').css('color', 'black'); // Change all links back to the default color
$('a[href="' + currentSection + '"].nav-item').css('color', 'var(--theme-color)'); // Change the color of the current section's link
});
$(function(){
$(window).scroll(function(){
if($(this).scrollTop() >= 80){
$('.onscroll-fiex').addClass('fixed-nav');
}else{
$('.onscroll-fiex').removeClass('fixed-nav');
}
});
});
$('.hover-img').click(function(){
$('.gallery').removeClass('gallery');
$(this).addClass('gallery');
});
$(document).on("click", function(event) {
// Check if the click is outside the div
if (!$(event.target).closest(".gallery").length) {
// Close the div
$('.gallery').removeClass('gallery');
}
});
});