1 2 3jQuery(document).ready(function ($) { 4 5 6 let HeighHeader= $('.top-header').innerHeight(); 7 let HeighHeaderBottom= $('.bottom-header').innerHeight(); 8 9 10 11 $(".bzhdanchor a").on('click', function(event) { 12 let hash = this.hash; 13 14 let url= window.location.href.split('#')[0]; 15 let url2= $(this).attr('href').split('#')[0]; 16 17 18 19 if( url === url2 ){ 20 // Prevent default anchor click behavior 21 if (this.hash !== "") { 22 23 24 event.preventDefault(); 25 26 27 // Store hash 28 $('html, body').animate({ 29 scrollTop: $(hash).offset().top - HeighHeaderBottom 30 }, 'slow', function(){ 31 32 // Add hash (#) to URL when done scrolling (default click behavior) 33 history.pushState({}, null, hash); 34 }); 35 } 36 37 }else{ 38 window.location = event.target; 39 } 40 41 42 43 }); 44 45 46 47 var MainWindowWidth = $(window).width(); 48 49 $(window).on('resize', function () { 50 MainWindowWidth = $(window).width(); 51 menuSimpleHover(); 52 if (MainWindowWidth < 1024) { 53 54 $( "li.sf-menu" ).children('ul.swap-js').removeClass('show'); 55 56 $('ul.swap-js').css({ 57 left: '0', 58 }); 59 } 60 }); 61 62// menuSimpleHover(); 63 64 if (MainWindowWidth < 1024) { 65 66 $( "li.sf-menu" ).children('ul.swap-js').removeClass('show'); 67 68 $('ul.swap-js').css({ 69 left: '0', 70 }); 71 }else{ 72 menuSimpleHover(); 73 } 74 75 76 function menuSimpleHover() { 77 78 79 $( "li.sf-menu" ).hover( 80 function() { 81 $(this).children('ul.swap-js').addClass('show'); 82 83 }, function() { 84 $(this).children('ul.swap-js').removeClass('show'); 85 } 86 ); 87 88 $('.cd-dropdown-wrapper .cd-dropdown-content').on('mouseover', 'ul li.sf-menu, .sub-menu-item', function () { 89 // $('.mainmenu').on('mouseover', 'ul li', function(){ 90 if (MainWindowWidth > 1024) { 91 92 var $this = $(this); 93 // checks if third level menu exist 94 var subMenuExist = $this.find('ul').length; 95 if (subMenuExist > 0) { 96 97 var subMenuWidth = $this.find('ul, div').first().width(); 98 var subMenuOffset = $this.find('ul, div').first().parent().offset().left + subMenuWidth; 99 // if sub menu is off screen, give new position 100 101 if ((subMenuOffset + subMenuWidth) > MainWindowWidth) { 102 var newSubMenuPosition = subMenuWidth + 0; 103 $this.find('ul.swap-js, div').first().css({ 104 left: -newSubMenuPosition, 105 }); 106 } else { 107 $this.find('ul.swap-js, div').first().css({ 108 left: '100%', 109 }); 110 } 111 } 112 } 113 114 //1st level 115 }).on('mouseover', '> li', function () { 116 if (MainWindowWidth > 1024) { 117 118 var $this = $(this); 119 var subMenuExist = $this.find('ul').length; 120 if (subMenuExist > 0) { 121 var subMenuWidth = $this.find('ul').width(); 122 var subMenuOffset = $this.find('ul').parent().offset().left; 123 // if sub menu is off screen, give new position 124 if ((subMenuOffset + subMenuWidth) > MainWindowWidth) { 125 var newSubMenuPosition = MainWindowWidth - (subMenuOffset + subMenuWidth); 126 $this.find('ul.swap-js').first().css({ 127 left: newSubMenuPosition, 128 }); 129 } 130 } 131 } 132 }); 133 } 134 135 136 137 138 139 140 141 142 143 144// ===== Scroll to Top ==== 145 146 $(window).scroll(function() { 147 if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px 148 $('.main-return-to-top').fadeIn(200); 149 } else { 150 $('.main-return-to-top').fadeOut(200); // Else fade out the arrow 151 } 152 }); 153 154 $('.return-to-top').click(function() { // When arrow is clicked 155 $('body,html').animate({ 156 scrollTop : 0 // Scroll to top of body 157 }, 500); 158 }); 159 160 161 162 163 164 165 166 167 // ===== Fixed menu Top ==== 168 169 $(window).scroll(function() { 170 if (MainWindowWidth <= 1023) { 171 $('.affix-top-wrapper').removeClass('bzhd-fixed-top'); 172 $('.top-header').css("height","auto"); 173 return; 174 }else{ 175 $('.top-header').css("height",HeighHeader); 176 } 177 if ($(this).scrollTop() >= HeighHeader) { 178 $('.affix-top-wrapper').addClass('bzhd-fixed-top'); 179 } else { 180 $('.affix-top-wrapper').removeClass('bzhd-fixed-top'); 181 } 182 183 }); 184 185 $(window).on('resize', function(){ 186 MainWindowWidth = $(window).width(); 187 }); 188 189 $(document).on('click', '[data-toggle="lightbox"]', function(event) { 190 event.preventDefault(); 191 $(this).ekkoLightbox(); 192 }); 193 194 195 $('.slide-w-b-txt-1').owlCarousel({ 196 loop:true, 197 autoplay: true, 198 autoHeight : true, 199 animateOut: 'fadeOut', 200 animateIn:'fadeIn', 201 margin:0, 202 nav:false, 203 dots: false, 204 autoplayHoverPause: true, 205 items: 1, 206 navClass :['carousel-control-prev cust-btn','cust-btn carousel-control-next'], 207 navText : ["<i class='ti-angle-left'></i>","<i class='ti-angle-right'></i>"], 208 responsive:{ 209 0:{ 210 items:1 211 }, 212 600:{ 213 items:1 214 }, 215 1000:{ 216 items:1 217 } 218 } 219 }); 220 221 $('.slide-flash').owlCarousel({ 222 loop:true, 223 autoplay: true, 224 smartSpeed: 1000, 225 margin:0, 226 nav:true, 227 dots: true, 228 autoplayHoverPause: true, 229 items: 1, 230 navClass :['carousel-control-prev cust-btn','cust-btn carousel-control-next'], 231 navText : ["<i class='ti-angle-left'></i>","<i class='ti-angle-right'></i>"], 232 responsive:{ 233 0:{ 234 items:1 235 }, 236 600:{ 237 items:1 238 }, 239 1000:{ 240 items:1 241 } 242 } 243 }); 244 245 246 247 248}(jQuery));
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.