//Sidebar call $(document).ready(function () { $("#sidebar").mCustomScrollbar({ theme: "minimal" }); $('#dismiss, .overlay').on('click', function () { $('#sidebar').removeClass('active'); $('.overlay').removeClass('active'); }); $('#sidebarCollapse').on('click', function () { $('#sidebar').addClass('active'); $('.overlay').addClass('active'); $('.collapse.in').toggleClass('in'); $('a[aria-expanded=true]').attr('aria-expanded', 'false'); }); }); $(document).ready(function($) { var owl = $("#homeCarousel"); owl.owlCarousel({ items : 1, smartSpeed:450, rewind: true, autoplay: false, autoplayTimeout: 8000, autoplayHoverPause: true, checkVisible: false }); }); $(document).ready(function() { // executes when HTML-Document is loaded and DOM is ready // breakpoint and up $(window).resize(function(){ if ($(window).width() >= 980){ // when you hover a toggle show its dropdown menu $("#mainMenu .navbar .itsl-dropdown-menu").hover(function () { $(this).parent().toggleClass("show"); $(this).parent().find(".itsl-dropdown-menu").toggleClass("show"); }); // hide the menu when the mouse leaves the dropdown $( "#mainMenu .navbar .itsl-dropdown-menu" ).mouseleave(function() { $(this).removeClass("show"); }); // do something here } }); // document ready }); //sidebar submenu $(document).ready(function() { $('.itsl-sidebar-main li.has-submenu > a').on('click', function () { //TODO: Hide list item of parent to show top border spacing of border var totalMenuItems = $('.itsl-sidebar-main > li').length; var noOfSubMenus = $(this).siblings( "ul" ).find('li').length; var parentSiblingItems = $(this).parent('.has-submenu').siblings('li').length; if(parentSiblingItems ) //alert(noOfSubMenus); $('.itsl-sidebar-main > li:gt('+noOfSubMenus+')').hide(); var diff = totalMenuItems - noOfSubMenus; $('#sidebar a.navbar-brand').hide(); $('.itsl-sidebar-main').addClass('itsl-theme-border-top'); $('.menu-text, #backIcn').show(); }); $('#backIcn').on('click', function () { $('.menu-text, #backIcn').hide(); $('.itsl-sidebar-main').removeClass('itsl-theme-border-top'); $('#sidebar a.navbar-brand').show(); $('.itsl-sidebar-main li.has-submenu .collapse').removeClass('show'); $('.itsl-sidebar-main > li').show(); }); }); // $( document ).ready(function() { // // $(function () { // $("#howToJoin").bootstrapNews({ // newsPerPage: 5, // autoplay: false, // animationSpeed: 'normal', // }); // }); // }); $(function () { $('.button-checkbox').each(function () { // Settings var $widget = $(this), $button = $widget.find('button'), $checkbox = $widget.find('input:checkbox'), color = $button.data('color'), settings = { on: { icon: 'ml-1 fa fa-check' }, off: { icon: 'ml-1 fa fa-plus' } }; // Event Handlers $button.on('click', function () { $checkbox.prop('checked', !$checkbox.is(':checked')); $checkbox.triggerHandler('change'); updateDisplay(); }); $checkbox.on('change', function () { updateDisplay(); }); // Actions function updateDisplay() { var isChecked = $checkbox.is(':checked'); // Set the button's state $button.data('state', (isChecked) ? "on" : "off"); // Set the button's icon $button.find('.state-icon') .removeClass() .addClass('state-icon ' + settings[$button.data('state')].icon); // Update the button's color if (isChecked) { $button .removeClass('btn-default') .addClass('btn-' + color + ' active'); } else { $button .removeClass('btn-' + color + ' active') .addClass('btn-default'); } } // Initialization function init() { updateDisplay(); // Inject the icon if applicable if ($button.find('.state-icon').length == 0) { $button.append(' '); } } init(); }); }); //Script to make all boxes with same height function sameHeight(parent,child) { var tallest = 0; $(child).each(function(){ thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); if(tallest > 0){ $(parent).find(child).css({'height': tallest+'px'}); } return true; } $(document).ready(function(){ sameHeight(".itsl-row-item",".itsl-sub-title"); sameHeight(".itsl-article-grid",".itsl-grid-img"); sameHeight(".kanvic-article-grid-row",".itsl-item-text"); }); // Breadcrumb Navigation Functionality $(document).ready(function() { // Check if breadcrumb navigation exists if ($('.breadcrumb-navigation').length > 0) { const breadcrumbNavigation = $('.breadcrumb-navigation'); const breadcrumbLinks = $('.breadcrumb-link'); const breadcrumbActive = $('.breadcrumb-active'); const sections = $('.block-section[id^="section-"]'); // Get the initial position of the breadcrumb navigation const breadcrumbOffset = breadcrumbNavigation.offset().top; const headerHeight = $(window).width() >= 992 ? 75 : 80; // Smooth scroll to section when breadcrumb link is clicked breadcrumbLinks.on('click', function(e) { e.preventDefault(); const targetId = $(this).attr('href'); const targetSection = $(targetId); if (targetSection.length) { // Remove active class from all links breadcrumbLinks.removeClass('active'); // Add active class to clicked link $(this).addClass('active'); // Update active breadcrumb text - use current menu title if available, otherwise use link text const currentMenuTitle = breadcrumbNavigation.data('current-menu-title'); const activeText = currentMenuTitle || $(this).text(); breadcrumbActive.text(activeText); // Calculate scroll position with breadcrumb offset const scrollOffset = breadcrumbNavigation.hasClass('fixed') ? headerHeight + breadcrumbNavigation.outerHeight() : 100; // Smooth scroll to target section $('html, body').animate({ scrollTop: targetSection.offset().top - scrollOffset }, 800); } }); // Update active breadcrumb based on scroll position function updateActiveBreadcrumb() { const scrollTop = $(window).scrollTop(); const windowHeight = $(window).height(); const documentHeight = $(document).height(); let activeSection = null; let minDistance = Infinity; const scrollOffset = breadcrumbNavigation.hasClass('fixed') ? headerHeight + breadcrumbNavigation.outerHeight() + 20 : 150; sections.each(function() { const section = $(this); const sectionTop = section.offset().top - scrollOffset; const sectionBottom = sectionTop + section.outerHeight(); // Check if section is in viewport if (scrollTop >= sectionTop && scrollTop <= sectionBottom) { const distance = Math.abs(scrollTop - sectionTop); if (distance < minDistance) { minDistance = distance; activeSection = section.attr('id'); } } }); // If no section is in viewport, find the closest one if (!activeSection) { sections.each(function() { const section = $(this); const sectionTop = section.offset().top - scrollOffset; const distance = Math.abs(scrollTop - sectionTop); if (distance < minDistance) { minDistance = distance; activeSection = section.attr('id'); } }); } // Update active breadcrumb link and text if (activeSection) { breadcrumbLinks.removeClass('active'); const activeLink = breadcrumbLinks.filter('[href="proxy.php?url=#' + activeSection + '"]'); activeLink.addClass('active'); // Update active breadcrumb text - use current menu title if available, otherwise use link text const currentMenuTitle = breadcrumbNavigation.data('current-menu-title'); const activeText = currentMenuTitle || activeLink.text(); breadcrumbActive.text(activeText); } } // Handle breadcrumb visibility and fixed positioning let hasScrolled = false; $(window).on('scroll', function() { const scrollTop = $(window).scrollTop(); // Show breadcrumb navigation on first scroll if (!hasScrolled && scrollTop > 50) { hasScrolled = true; breadcrumbNavigation.addClass('visible'); } // Hide breadcrumb navigation when back to top if (hasScrolled && scrollTop <= 50) { hasScrolled = false; breadcrumbNavigation.removeClass('visible'); } // Handle fixed positioning - only when mainScrollerMenu is visible (scroll > 100px) if (scrollTop > 100) { breadcrumbNavigation.addClass('fixed'); } else { breadcrumbNavigation.removeClass('fixed'); } }); // Throttle scroll event for active breadcrumb updates (performance optimization) let scrollTimeout; $(window).on('scroll', function() { if (scrollTimeout) { clearTimeout(scrollTimeout); } scrollTimeout = setTimeout(updateActiveBreadcrumb, 100); }); // Initial call to set active breadcrumb updateActiveBreadcrumb(); } });