document.addEventListener("DOMContentLoaded", function () { if (window.innerWidth <= 768) { const modal = document.getElementById("mobileModal"); const closeBtn = modal.querySelector(".btn-close"); // Show modal modal.classList.add("show"); // Close modal on button click closeBtn.addEventListener("click", () => { modal.classList.remove("show"); }); } }); $(document).ready(function () { // Delay to make sure swiper elements are fully added from CDN script setTimeout(function () { $('.h_alumni_list [role="group"]').each(function () { const tag = $(this).prop('tagName').toLowerCase(); if (tag !== 'div') { $(this).removeAttr('role'); console.log('Removed role="group" from <' + tag + '> inside .h_alumni_list'); } }); }, 300); // Delay slightly if swiper is injected dynamically }); (function ($) { "use strict"; adjustMaxContent(); adjustBodyPadding(); // Anchor Smooth Scroll Start jQuery(function ($) { function scrollToHash(hash) { var target = $(hash); $("html,body").animate({ scrollTop: target.offset().top - 120 }, "linear" ); } $('a[href*="#"]:not([href="#"])').click(function () { scrollToHash(this.hash); }); $(window).on("load", function () { if (location.hash) { scrollToHash(location.hash); } }); }); // Header sticky $(window).scroll(function () { var sticky = $("body"), scroll = $(window).scrollTop(); if (scroll >= 100) sticky.addClass("sticky"); else sticky.removeClass("sticky"); }); // Body Padding Adjustment Start function adjustBodyPadding() { const header = document.querySelector('.main_header'); const body = document.querySelector('.inner_main'); if (header && body) { setTimeout(function () { const headerHeight = header.offsetHeight; body.style.paddingTop = headerHeight + 'px'; }, 100); } } // Call the function on page load window.addEventListener('load', adjustBodyPadding); // Call the function on window resize to keep it responsive window.addEventListener('resize', adjustBodyPadding); // Body Padding Adjustment End $(document).ready(function () { function setDropmenuPadding() { // Find the active list item let activeLi = $(".hamb_panel ul > li.active"); if (activeLi.length) { // Get the height and position of the active li let liOffsetTop = activeLi.position().top; // Apply padding-top to .hamb_dropmenu $(".hamb_dropmenu").css("padding-top", liOffsetTop + "px"); } } function initializeFirstDropmenu() { let firstDropmenu = $(".dropmenu:first"); firstDropmenu.addClass("active"); let firstTarget = firstDropmenu.data("target"); if (firstTarget) { $(firstTarget).addClass("show"); } setDropmenuPadding(); // Set padding for the first dropmenu } initializeFirstDropmenu(); // Hover event for dropmenu $(".dropmenu").hover(function () { if ($(this).hasClass("active")) return; // Remove active class and 'show' class from siblings $(this).siblings(".dropmenu").removeClass("active").each(function () { let siblingTarget = $(this).data("target"); if (siblingTarget) { $(siblingTarget).removeClass("show"); } }); // Add active class to the hovered element $(this).addClass("active"); // Show the target of the hovered element let o = $(this).data("target"); if (o) { $(o).addClass("show").siblings().removeClass("show"); // Check if no item from .drop_menu1 is shown, then hide hamb_menu_item if (!$(".drop_menu1").hasClass("show")) { $(".hamb_dropmenu").find(".hamb_menu_item").removeClass("show"); } } setDropmenuPadding(); // Set padding when hovering a dropmenu }); // Close button click event $(".ham_close").click(function () { $(".dropmenu").removeClass("active"); $(".hamb_dropmenu").removeClass("show"); $(".hamb_menu_item").removeClass("show"); initializeFirstDropmenu(); }); // Hover event for
  • elements in the .hamb_panel $(".hamb_panel>ul>li").hover(function () { // Remove active class and hide previous hamb_dropmenu $(".hamb_panel>ul>li").removeClass("active"); $(".hamb_dropmenu").removeClass("show"); // Add active class to hovered
  • $(this).addClass("active"); // Show corresponding hamb_dropmenu based on data-target or other logic let target = $(this).data("target"); if (target) { $(target).addClass("show"); // Set padding-top of hamb_dropmenu according to the active li setDropmenuPadding(); } }); }); $(".ham_btn").click(function () { $(this).toggleClass("active"); $(".hamb_side").toggleClass("active"); }); $(".ham_close").click(function () { $(".hamb_side").removeClass("active"); }); // Mobile Menu function togglePanel(panelToShow, activeElement) { const isActive = $(panelToShow).hasClass("show"); $(".mobile-program-panel, .mobile-admission-panel, .mobile-contact-panel, .mobile-menulist-panel").removeClass("show"); if (!isActive) { $(panelToShow).addClass("show"); } $(".program_tab, .admission_tab, .contact_tab, .menu_tab").removeClass("active"); if (!isActive) { $(activeElement).addClass("active"); } } $(".program_tab").click(function () { togglePanel(".mobile-program-panel", this); }); $(".admission_tab").click(function () { togglePanel(".mobile-admission-panel", this); }); $(".contact_tab").click(function () { togglePanel(".mobile-contact-panel", this); }); $(".menu_tab").click(function () { togglePanel(".mobile-menulist-panel", this); }); // Mobile Menu Tab End $(".menu_mobile li a").click(function (e) { // remove the active class with every click var same = $(this).hasClass("active"); var siblings = $(this).parent(".menu_item").parent().children(); siblings.find("a.active + .sub_menu").slideUp(); siblings.find("a").removeClass("active"); if ($(this).next().hasClass("sub_menu") && !same) { e.preventDefault(); $(this).addClass("active"); $(this).next(".sub_menu").slideDown(); } }); // Revel Animation End $(window).resize(function () { adjustMaxContent(); }); function adjustMaxContent() { let containerWidth = $(".container").width() //console.log([...containerWidth]); // containerWidth = $([...containerWidth][2]).width(); let windowWidth = $("body").width(); windowWidth = windowWidth > 1920 ? 1920 : windowWidth; let maxContentWidth = (windowWidth - (windowWidth - containerWidth) / 2) + 13; if (windowWidth >= 1400) { $(".max-content-xxl").css("max-width", `${maxContentWidth}px`); $(".max-content-xl").css("max-width", `${maxContentWidth}px`); $(".max-content-lg").css("max-width", `${maxContentWidth}px`); $(".max-content-md").css("max-width", `${maxContentWidth}px`); $(".max-content-sm").css("max-width", `${maxContentWidth}px`); $(".max-content").css("max-width", `${maxContentWidth}px`); } else if (windowWidth >= 1200) { $(".max-content-xxl").css("max-width", ""); $(".max-content-xl").css("max-width", `${maxContentWidth}px`); $(".max-content-lg").css("max-width", `${maxContentWidth}px`); $(".max-content-md").css("max-width", `${maxContentWidth}px`); $(".max-content-sm").css("max-width", `${maxContentWidth}px`); $(".max-content").css("max-width", `${maxContentWidth}px`); } else if (windowWidth >= 992) { $(".max-content-xxl").css("max-width", ""); $(".max-content-xl").css("max-width", ""); $(".max-content-lg").css("max-width", `${maxContentWidth}px`); $(".max-content-md").css("max-width", `${maxContentWidth}px`); $(".max-content-sm").css("max-width", `${maxContentWidth}px`); $(".max-content").css("max-width", `${maxContentWidth}px`); } else if (windowWidth >= 768) { $(".max-content-xxl").css("max-width", ""); $(".max-content-xl").css("max-width", ""); $(".max-content-lg").css("max-width", ""); $(".max-content-md").css("max-width", `${maxContentWidth}px`); $(".max-content-sm").css("max-width", `${maxContentWidth}px`); $(".max-content").css("max-width", `${maxContentWidth}px`); } else if (windowWidth >= 575) { $(".max-content-xxl").css("max-width", ""); $(".max-content-xl").css("max-width", ""); $(".max-content-lg").css("max-width", ""); $(".max-content-md").css("max-width", ""); $(".max-content-sm").css("max-width", `${maxContentWidth}px`); $(".max-content").css("max-width", `${maxContentWidth}px`); } else { $(".max-content-xxl").css("width", ""); $(".max-content-xl").css("width", ""); $(".max-content-lg").css("width", ""); $(".max-content-md").css("width", ""); $(".max-content-sm").css("width", ""); $(".max-content").css("width", `${maxContentWidth}px`); } } // Menu Adjust End // gallery box Start $('.gallery_custom').each(function () { // console.log('kjaskd') let target = `.gallery${$(this).data('albumid')}`; $(target).rbox({}); }) // gallery box End })(jQuery); // Swiper: Slider $(function () { // Owl Carousel if ($(".owl-carousel") && $(".owl-carousel")?.length) { var owl = $(".owl-carousel"); owl.owlCarousel({ items: 1, margin: 10, loop: true, nav: true, autoplay: true }); } }); // Open the search panel when the search icon is clicked $('.search-toggle').click(function () { $('.search').addClass('open'); // Show the search panel $('.overlay').addClass('open'); // Optionally, show an overlay }); // Close the search panel when the close button is clicked $('.close-btn').click(function () { $('.search').removeClass('open'); // Hide the search panel $('.overlay').removeClass('open'); // Optionally, hide the overlay $('.overlay1').removeClass('open'); // Optionally, hide the overlay }); $('#toggle').click(function () { $(this).toggleClass('active'); $('#overlay1').toggleClass('open'); }); // Mobile Bottom Sticky $(function () { $('.mobile-bottom-menu .togglee').click(function () { if ($(this).hasClass('active')) { $('.side-menu').removeClass('show-menu'); $(this).removeClass('active'); } else { $(this).addClass('active'); } $(this).parent().siblings().children().removeClass('active'); }); }); $(document).ready(function () { $(".course_sec").on("click", function () { $(".course-brands_wrap").toggleClass("show"); $(".admissions-services_wrap").removeClass("show1"); $(".contact_wrap").removeClass("show2"); $(".menu_wrap").removeClass("show3"); $(".enquiry_panel_wrap").removeClass("show"); }); }); $(document).ready(function () { $(".enquiry_pan").on("click", function () { $(".enquiry_panel_wrap").toggleClass("show"); $(".course-brands_wrap").removeClass("show"); $(".admissions-services_wrap").removeClass("show1"); $(".contact_wrap").removeClass("show2"); $(".menu_wrap").removeClass("show3"); }); }); $(document).ready(function () { $(".admissions-services").on("click", function () { $(".admissions-services_wrap").toggleClass("show1"); $(".course-brands_wrap").removeClass("show"); $(".contact_wrap").removeClass("show2"); $(".menu_wrap").removeClass("show3"); $(".enquiry_panel_wrap").removeClass("show"); }); }); // $(document).ready(function () { // $(".contact").on("click", function () { // $(".contact_wrap").toggleClass("show2"); // $(".course-brands_wrap").removeClass("show"); // $(".admissions-services_wrap").removeClass("show1"); // $(".menu_wrap").removeClass("show3"); // $(".enquiry_panel_wrap").removeClass("show"); // }); // }); $(document).ready(function () { $(".menu").on("click", function () { $(".menu_wrap").toggleClass("show3"); $(".course-brands_wrap").removeClass("show"); $(".admissions-services_wrap").removeClass("show1"); $(".contact_wrap").removeClass("show2"); $(".enquiry_panel_wrap").removeClass("show"); }); }); document.addEventListener('DOMContentLoaded', function () { // Get all the h4 elements with class 'toggle-header' const toggleHeaders = document.querySelectorAll('.toggle-header'); // Add click event listener to each header toggleHeaders.forEach(function (header) { header.addEventListener('click', function () { // Find the corresponding