1// menu header 2function mobileMenu() { 3 const windowWidth = $(window).width(); 4 const headerHeight = $('.header').height(); 5 let menuBox = $('.menu-items'); 6 7 $('.menu-hamburger').click(function () { 8 $(this).siblings('.menu-overlay').addClass('active'); 9 $(this).siblings('.menu-items').addClass('active'); 10 $(this).addClass('menu-open'); 11 $('.menu-close').addClass('active'); 12 }); 13 14 $('.jsClose-mobileMenu').click(function () { 15 $('.menu-items').removeClass('active'); 16 $('.menu-hamburger').removeClass('menu-open'); 17 $('.menu-close').removeClass('active'); 18 }); 19 20 if (windowWidth < 992) { 21 menuBox.css('top', headerHeight); 22 menuBox.css({ height: `calc(100% - ${headerHeight}px)` }); 23 24 $('.menu-parent i').click(function () { 25 $(this) 26 .toggleClass('active') 27 .parent() 28 .siblings('.menu-sub') 29 .slideToggle(); 30 }); 31 } 32 33 // $(document).mouseup(function (e) { 34 // if ( 35 // !$('.menu-items').is(e.target) && 36 // $('.menu-items').has(e.target).length === 0 37 // ) { 38 // $('.menu-items').siblings('.menu-overlay').removeClass('active'); 39 // $('.menu-items').removeClass('active'); 40 // } 41 // }); 42} 43 44function activeFixedHeader() { 45 var headerHeight = $('.header').innerHeight(); 46 var windowWidth = $(window).width(); 47 48 $(window).scroll(function () { 49 var windowScrollTop = $(window).scrollTop(); 50 var firstSection = $('main div,main section').first().innerHeight(); 51 var bannerCalc = firstSection - headerHeight; 52 53 if (windowScrollTop) $('.header').addClass('active'); 54 else $('.header').removeClass('active'); 55 }); 56 57 if (windowWidth < 992) { 58 $('main').css('margin-top', headerHeight); 59 } 60} 61 62function scrollReveal() { 63 const sr = ScrollReveal({ 64 distance: '100px', 65 // delay: 500, 66 duration: 1500, 67 origin: 'bottom' 68 }); 69 70 sr.reveal('.title-component', { origin: 'top' }); 71 72 sr.reveal('.section-banner', { 73 distance: '0', 74 duration: 1000, 75 easing: 'ease' 76 }); 77 78 sr.reveal('.section-introduce .row', {}); 79 80 sr.reveal('.section-introduce .title-component', { 81 origin: 'bottom', 82 scale: 0.8 83 }); 84 85 sr.reveal('.section-product .row', {}); 86 87 sr.reveal('.js--gallery-slide', {}); 88 89 sr.reveal('.section--col .row', { 90 scale: 0.8 91 }); 92 93 sr.reveal('.news--list', {}); 94 95 sr.reveal('.swiperPartner', { 96 scale: 0.8 97 }); 98} 99 100function scrollToTop() { 101 $('#scrollToTop .event-onClick').click(function () { 102 $([document.documentElement, document.body]).animate( 103 { 104 scrollTop: $('html,body').offset().top 105 }, 106 1000 107 ); 108 }); 109} 110 111$(document).ready(function () { 112 $(window).scrollTop(0); 113 mobileMenu(); 114 activeFixedHeader(); 115 scrollToTop(); 116});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.