$(document).ready(function() { // Tooltip Js $(function () { $('[data-toggle="tooltip"]').tooltip() }); //For Menu Drop-down Focus (sub-menu) const topLevelLinks = document.querySelectorAll('.dropdown-toggle'); console.log(topLevelLinks); topLevelLinks.forEach(link => { if (link.nextElementSibling) { link.addEventListener('focus', function() { this.parentElement.classList.add('focus', 'open'); }); const subMenu = link.nextElementSibling; const subMenuLinks = subMenu.querySelectorAll('a'); const lastLinkIndex = subMenuLinks.length - 1; const lastLink = subMenuLinks[lastLinkIndex]; lastLink.addEventListener('blur', function() { link.parentElement.classList.remove('focus', 'open'); }); } }); // Menu Onhover to Fix Js /* $(document).ready(function(){ $(window).bind('scroll', function() { var navHeight = $( window ).height() - 700; if ($(window).scrollTop() > navHeight) { $('.navbar-custom').addClass('navbar-fixed'); } else { $('.navbar-custom').removeClass('navbar-fixed'); } }); }); */ // New Menu onScroll to Fix Js jQuery(window).scroll(function(){ if (jQuery(window).scrollTop() >= 90) { jQuery('.header-sticky').addClass('navbar-fixed'); jQuery('.header-sticky').removeClass('not-sticky'); jQuery('.navbar-collapse').removeClass('show'); } else { jQuery('.header-sticky').removeClass('navbar-fixed'); jQuery('.header-sticky').addClass('not-sticky'); } }); // on scroll menu animation /* jQuery(window).scroll(function(){ var top = jQuery(window).scrollTop(); if(top > 10){ jQuery(".navbar-custom").stop().animate({height: '92px'}, "slow"); } else { jQuery(".navbar-custom").stop().animate({height: '100px'}, "slow"); } }) // Accodian Js function toggleIcon(e) { jQuery(e.target) .prev('.panel-heading') .find(".more-less") .toggleClass('fa-plus-square-o fa-minus-square-o'); } jQuery('.panel-group').on('hidden.bs.collapse', toggleIcon); jQuery('.panel-group').on('shown.bs.collapse', toggleIcon); */ });