1// === TEDDY === 2$(document).ready(function () { 3 4 // FASHION MENU ========== 5 function Menu(){ 6 $('.menu-dd').each(function() { 7 var $this = $(this); 8 var Nli = $this.find('li').length; 9 var Nlink = $this.find('a').length; 10 var Ncol = Math.ceil(Nlink / 15); 11 var Mbanner = $this.find('.cat-img').length; 12 13 Ncol = Ncol == 0 ? 1 : Ncol; 14 col = Nli > Ncol ? Ncol : Nli; 15 col = (col + (Mbanner ? 1 : 0) > 4) ? 4 : col; 16 $this.addClass('column' + col); 17 if (Mbanner){$this.addClass('banner');}; 18 if ($this.find('li span > a').length == 0){ 19 $this.addClass('no-sub'); 20 }; 21 }); 22 }; 23 Menu(); 24 25 $('.main-header .menu-drop').on('mouseenter', function() { 26 $('.main-header .menu-drop .menu-dd').removeClass('open'); 27 $(this).children('.menu-dd').stop().addClass('open'); 28 if ( $('.slide-item-menu').length ) { 29 $('.slide-item-menu').owlCarousel({items:1,navigation:!0,pagination:!1}); 30 var owl = $('.slide-item-menu'); 31 var owlInstance = owl.data('owlCarousel'); 32 if(owlInstance != null) 33 owlInstance.reinit(); 34 }; 35 }).on('mouseleave', function() { 36 $('.main-header .menu-drop .menu-dd').removeClass('open'); 37 }); 38 39 $('.search-form-box.search-toggle').prepend('<a class="search-modal -g-no-url" href="#"><i style="" class="fa fa-times search-close" aria-hidden="true"></i></a>'); 40 41 $(document).on('click', '.search-modal', function(event) { 42 event.preventDefault(); 43 $('.main-header .acount-section .search-m').trigger('click'); 44 $('#_autocompleteSearchMobileToggle').val(''); 45 }); 46 47 $.Gomag.bind('Widget/Add/After', function(){ 48 // BF SIDEBAR + MENU STICKY 49 if($('.-g-template-black-friday').length){ 50 $('.main-header').css({'top' : '-' + $('.discount-tape').height() + 'px'}); 51 } 52 if($( window ).width() > 991 && $('.-g-template-black-friday').length){ 53 $('.landing-h .side-menu.fixed').css({'top' : $('.main-header .top-head-bg').outerHeight() + 20 + 'px'}); 54 } 55 // DETAIL SLIDER + INFO STICKY 56 /*if($( window ).width() > 768 && $('.product-page-holder').length){ 57 $('.product-page-holder .detail-slider-holder').css({'top' : $('.main-header').outerHeight() + 'px'}); 58 $('.product-page-holder .-g-product-details-holder').css({'top' : $('.main-header').outerHeight() + 20 + 'px'}); 59 }*/ 60 }); 61 62 $.Gomag.bind('Gomag/Product/Detail/Loaded', function(){ 63 64 if($( window ).width() > 768 && $('.product-page-holder').length){ 65 66 var header = $('.main-header'); 67 var stickySlider = $('.product-page-holder .detail-slider-holder'); 68 var stickyDetail = $('.product-page-holder .-g-product-details-holder'); 69 var prevScroll = $(window).scrollTop(); 70 71 function adjustSticky() { 72 var sliderOffsetTop = stickySlider.height(); 73 var stickyOffsetTop = stickyDetail.height(); 74 var windowHeight = $(window).height(); 75 var currentScroll = $(this).scrollTop(); 76 77 if (stickyOffsetTop >= windowHeight && stickyOffsetTop < sliderOffsetTop) { 78 var negativeOffset = stickyOffsetTop - windowHeight; 79 stickyDetail.css('top', '-' + negativeOffset + 'px'); 80 } else { 81 var headerHeight = header.height(); 82 stickySlider.css('top', headerHeight + 'px'); 83 stickyDetail.css('top', headerHeight + 'px'); 84 } 85 } 86 87 adjustSticky(); 88 89 $(window).on('scroll', function() { 90 adjustSticky(); 91 }); 92 93 $(window).on('resize', function() { 94 adjustSticky(); 95 }); 96 }; 97 98 }); 99 100}); 101 102function adjustMenuPosition() { 103 $('.nav-menu-hh .menu-dd').each(function() { 104 $(this).css('left', 0); 105 106 const menudd = $(this)[0].getBoundingClientRect(); 107 108 if (menudd.right >= window.innerWidth - 60) { 109 const offset = menudd.right - window.innerWidth + 60; 110 $(this).css('left', `-${offset}px`); 111 } else { 112 $(this).css('left', 0); 113 } 114 }); 115} 116 117window.onload = function() { 118 adjustMenuPosition(); 119};
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.