jQuery(function($) { /* ----------------------------------------- Banner Section ----------------------------------------- */ $('.single-item.banner-slider').slick({ autoplaySpeed: 3000, dots: false, arrows: true, nextArrow: '', prevArrow: '', rtl: $.RtlCheck(), responsive: [{ breakpoint: 1025, settings: { arrows: false, dots: true, } }] }); /* ----------------------------------------- Banner Tab ----------------------------------------- */ $('.tab-wrapper').each(function(index) { $(this).find('.banner-tab-container:not(:first-child)').hide(); $(this).find('.banner-tabs li:not(:first-child) a').addClass('inactive'); }); $('.banner-tabs li a').click(function() { var t = $(this).attr('href'); $(this).closest('.tab-wrapper').find('.banner-tabs li a').addClass('inactive'); $(this).removeClass('inactive'); $(this).closest('.tab-wrapper').find('.banner-tab-container').hide(); $(this).closest('.tab-wrapper').find(t).fadeIn('slow'); return false; }); /* ----------------------------------------- Sticky Header ----------------------------------------- */ if ($("body").hasClass("header-fixed")) { const headers = document.querySelectorAll('.bottom-header-part'); headers.forEach(header => { window.addEventListener('scroll', function () { if (window.pageYOffset > 200) { header.classList.add('fix-header'); } else { header.classList.remove('fix-header'); } }); $(document).ready(function () { var divHeight = $(header).height(); // Calculate min-height for both containers including padding var totalMinHeight = divHeight + parseInt($(header).css('padding-top')) + parseInt($(header).css('padding-bottom')); $(header).closest('.bottom-header-outer-wrapper').css('min-height', totalMinHeight + 'px'); }); }); } });