1(function($){ 2 "use strict"; // Start of use strict 3 4 /* --------------------------------------------- 5 Owl carousel 6 --------------------------------------------- */ 7 function fixed_header(){ 8 var menu_element; 9 menu_element = $('.main-menu:not(.menu-fixed-content)').closest('.vc_row'); 10 if($('.menu-fixed-enable').length > 0 && $(window).width()>1024){ 11 var menu_class = $('.main-menu').attr('class'); 12 var header_height = $("#header").height()+100; 13 var ht = header_height + 150; 14 var st = $(window).scrollTop(); 15 16 if(!menu_element.hasClass('header-fixed') && menu_element.attr('data-vc-full-width') == 'true') menu_element.addClass('header-fixed'); 17 if(st>header_height){ 18 if(menu_element.attr('data-vc-full-width') == 'true'){ 19 if(st > ht) menu_element.addClass('active'); 20 else menu_element.removeClass('active'); 21 menu_element.addClass('fixed-header'); 22 } 23 else{ 24 if(st > ht) menu_element.parent().parent().addClass('active'); 25 else menu_element.parent().parent().removeClass('active'); 26 if(!menu_element.parent().parent().hasClass('fixed-header')){ 27 menu_element.wrap( "<div class='menu-fixed-content fixed-header "+menu_class+"'><div class='container'></div></div>" ); 28 } 29 } 30 }else{ 31 menu_element.removeClass('active'); 32 if(menu_element.attr('data-vc-full-width') == 'true') menu_element.removeClass('fixed-header'); 33 else{ 34 if(menu_element.parent().parent().hasClass('fixed-header')){ 35 menu_element.unwrap(); 36 menu_element.unwrap(); 37 } 38 } 39 } 40 } 41 else{ 42 menu_element.removeClass('active'); 43 if(menu_element.attr('data-vc-full-width') == 'true') menu_element.removeClass('fixed-header'); 44 else{ 45 if(menu_element.parent().parent().hasClass('fixed-header')){ 46 menu_element.unwrap(); 47 menu_element.unwrap(); 48 } 49 } 50 } 51 } 52 function init_carousel(){ 53 $('.kt-owl-carousel').each(function(){ 54 var config = $(this).data(); 55 //config.navText = ['<i class="fa fa-angle-left"></i>','<i class="fa fa-angle-right"></i>']; 56 var animateOut = $(this).data('animateout'); 57 var animateIn = $(this).data('animatein'); 58 59 if(typeof animateOut != 'undefined' ){ 60 config.animateOut = animateOut; 61 } 62 if(typeof animateIn != 'undefined' ){ 63 config.animateIn = animateIn; 64 } 65 // config.autoHeight = true; 66 var owl = $(this); 67 owl.owlCarousel(config); 68 $(this).find('.owl-item').removeClass('last-item'); 69 $(this).find('.owl-item.active').last().addClass('last-item'); 70 71 var t = $(this); 72 owl.on('changed.owl.carousel', function(event) { 73 var item = event.item.index; 74 t.find('.owl-item').removeClass('last-item'); 75 setTimeout(function(){ 76 t.find('.owl-item.active').last().addClass('last-item'); 77 }, 100); 78 79 }) 80 }); 81 } 82 83 /* Top menu*/ 84 function scrollCompensate(){ 85 var inner = document.createElement('p'); 86 inner.style.width = "100%"; 87 inner.style.height = "200px"; 88 var outer = document.createElement('div'); 89 outer.style.position = "absolute"; 90 outer.style.top = "0px"; 91 outer.style.left = "0px"; 92 outer.style.visibility = "hidden"; 93 outer.style.width = "200px"; 94 outer.style.height = "150px"; 95 outer.style.overflow = "hidden"; 96 outer.appendChild(inner); 97 document.body.appendChild(outer); 98 var w1 = parseInt(inner.offsetWidth); 99 outer.style.overflow = 'scroll'; 100 var w2 = parseInt(inner.offsetWidth); 101 if (w1 == w2) w2 = outer.clientWidth; 102 document.body.removeChild(outer); 103 return (w1 - w2); 104 } 105 106// function resizeTopmenu(){
107// if($(window).width() + scrollCompensate() >= 768){ 108// var main_menu_w = $('#main-menu').innerWidth(); 109// $("#main-menu ul.mega_dropdown").each(function(){ 110// var menu_width = $(this).innerWidth(); 111// var offset_left = $(this).position().left; 112// if(menu_width > main_menu_w){ 113// $(this).css('width',main_menu_w+'px'); 114// $(this).css('left','0'); 115// }else{ 116// if((menu_width + offset_left) > main_menu_w){ 117// var t = main_menu_w-menu_width; 118// var left = parseInt((t/2)); 119// $(this).css('left',left); 120// } 121// } 122// }); 123// } 124 function resizeTopmenu(){ 125 if($(window).width() + scrollCompensate() >= 768){ 126 var main_menu_w = $('#main-menu').innerWidth(); 127 $("#main-menu ul.mega_dropdown").each(function(){ 128 var menu_width = $(this).innerWidth(); 129 var offset_left = $(this).position().left; 130 if(menu_width > main_menu_w){ 131 $(this).css('width',main_menu_w+'px'); 132 $(this).css('right','0'); 133 }else{ 134 if((menu_width + offset_left) > main_menu_w){ 135 var t = main_menu_w-menu_width; 136 var left = parseInt((t/2)); 137 $(this).css('left',left); 138 } 139 } 140 }); 141 } 142 143 if($(window).width()+scrollCompensate() < 1025){ 144 $("#main-menu li.dropdown:not(.active) >a").attr('data-toggle','dropdown'); 145 }else{ 146 $("#main-menu li.dropdown >a").removeAttr('data-toggle'); 147 } 148 } 149 /* --------------------------------------------- 150 Stick menu 151 --------------------------------------------- */ 152 function stick_menu(){ 153 if($('#header .main-menu').length >0){ 154 var offset = $('#header .main-menu').offset(); 155 var header_height = offset.top; 156 var h = $(window).scrollTop(); 157 var width = $(window).width(); 158 if(width > 767){ 159 if(header_height==0){ 160 $('#header .main-menu').removeClass('main-menu-ontop'); 161 return; 162 } 163 if(h >= header_height){ 164 $('#header .main-menu').addClass('main-menu-ontop'); 165 }else{ 166 $('#header .main-menu').removeClass('main-menu-ontop'); 167 } 168 }else{ 169 $('#header .main-menu').removeClass('main-menu-ontop'); 170 } 171 } 172 173 } 174 175 function kt_bxslider(){ 176 $('.kt-bxslider').each(function(){ 177 var slider = $(this).bxSlider( 178 { 179 nextText:'<i class="fa fa-angle-right"></i>', 180 prevText:'<i class="fa fa-angle-left"></i>', 181 auto: true, 182 onSlideAfter: function(currentSlide, totalSlides, currentSlideHtmlObject){ 183 $('.bx-viewport li').removeClass('active-slide'); 184 $(currentSlideHtmlObject).addClass('active-slide'); 185 // $('#sddf').html('<p class="check">Slide index ' + currentSlide + ' of ' + totalSlides + ' total slides has completed.'); 186 } 187 } 188 ); 189 slider.reloadSlider(); 190 }) 191 192 } 193 194 /**============================== 195 *** Auto width megamenu 196 ===============================**/ 197 function auto_width_megamenu(){ 198 var full_width = parseInt($('.container').innerWidth()); 199 //full_width = $( document ).width(); 200 var menu_width = parseInt($('.vertical-menu-content').actual('width')); 201 $('.vertical-menu-content').find('.vertical-dropdown-menu').each(function(){ 202 $(this).width((full_width - menu_width)-32); 203 }); 204 } 205 function set_pos_megamenu(){ 206 if($('#main-menu').length > 0){ 207 if($('.rtl-enable').length > 0){ 208 var menu_pos = $(window).width() - ($('#main-menu').offset().left + $('#main-menu').outerWidth()); 209 $('li.has-mega-menu').each(function(){ 210 var sub_pos = $(window).width() - ($(this).offset().left + $(this).outerWidth()); 211 // $(this).find('.sub-menu').css('right',menu_pos-sub_pos); 212 $(this).find('.sub-menu').css('right',menu_pos-sub_pos); 213 // alert(menu_pos-sub_pos); 214 }) 215 } 216 else{ 217 var menu_pos = $('#main-menu').offset().left; 218 $('li.has-mega-menu').each(function(){ 219 var sub_pos = $(this).offset().left; 220 $(this).find('.sub-menu').css('left',menu_pos-sub_pos); 221 //$(this).find('.sub-menu').css('right',menu_pos-sub_pos); 222 }) 223 } 224 } 225 } 226 function fix_height_footer_item(){ 227 $('.footer-list-link .block-link-wapper').css('height',''); 228 if($(window).width() >= 568){ 229 var item_height = $('.footer-list-link .block-link-wapper').first().outerHeight(); 230 $('.footer-list-link .block-link-wapper').each(function(){ 231 var item_height2 = $(this).outerHeight(); 232 if(item_height2 > item_height) item_height = item_height2; 233 }) 234 $('.footer-list-link .block-link-wapper').css('height',item_height); 235 } 236 } 237 238 /* --------------------------------------------- 239 Scripts ready 240 --------------------------------------------- */ 241 var timelineW; 242var timelineInnerW; 243var timelineX; 244function bindtimelineFunctions() { 245 246} 247 248function moveTimeline(sIndex) { 249 var oldX = timelineX; 250 timelineX -= (timelineW * sIndex * .85); 251 if ((timelineX * -1) + timelineW > timelineInnerW) timelineX = (timelineInnerW - timelineW) * -1; 252 if (timelineX > 0) timelineX = 0;
253 if (oldX != timelineX) { 254 var dif = Math.abs(timelineX - oldX); 255 var speed = (dif * 0.5) + (50000 / dif); 256 257 $('#timelineInner').animate({ right: timelineX }, speed); 258 } 259} 260var jZoomablePic = function (sElem, sImgElem) { 261 this.elem = sElem; 262 this.imgElem = sImgElem; 263 this.zoomingStat = 0; 264 this.mouseStat = 0; 265 this.start = function () { 266 this.imgElem.data('me', this); 267 this.elem.data('me', this).bind('mouseenter', function () { 268 var me = $(this).data('me'); 269 me.mouseStat = 1; 270 me.zoomIn(); 271 }).bind('mouseleave', function () { 272 var me = $(this).data('me'); 273 me.mouseStat = 0; 274 me.zoomOut(); 275 }); 276 } 277 this.zoomIn = function () { 278 if (this.zoomingStat != 0) return; 279 this.zoomingStat = 1; 280 this.imgElem.animate({ left: '-7.25%', top: '-7.25%', width: '112.5%', height: '112.5%', opacity: 0.4 }, 200, function () { 281 var me = $(this).data('me'); 282 me.zoomingStat = 0; 283 if (me.mouseStat == 0) { 284 me.zoomOut(); 285 } 286 }); 287 } 288 this.zoomOut = function () { 289 if (this.zoomingStat != 0) return; 290 this.zoomingStat = -1; 291 this.imgElem.animate({ left: 0, top: 0, width: '100%', height: '100%', opacity: 1 }, 200, function () { 292 var me = $(this).data('me'); 293 me.zoomingStat = 0; 294 }); 295 } 296} 297var zoomablePic1; 298var zoomablePic2; 299//$("body").on('DOMSubtreeModified', "main-content", function() { 300 // alert('changed'); 301 $( document ).on( "mouseenter", "a:contains('Magic 360⢠trial version')", function() { 302 $("input[id^='m360Cr']") .hide(); 303}); 304 $(document).ready(function() { 305 /* M360 */ 306 // $("a:contains('Magic 360⢠trial version')").hide(); 307 308//}); 309 /* --------------------------------------------- 310 Header images 311 --------------------------------------------- */ 312 zoomablePic1 = new jZoomablePic($('#headerLeft'), $('#headerLeft').find('.headerImg').eq(0)); 313 zoomablePic1.start(); 314 zoomablePic2 = new jZoomablePic($('#headerRight'), $('#headerRight').find('.headerImg').eq(0)); 315 zoomablePic2.start(); 316 317 318 /* --------------------------------------------- 319 News 320 --------------------------------------------- */ 321 $(".newsHeader").click(function(){ 322 $(".newsConent").slideUp(); 323 $(this).next("div.newsConent").slideToggle("slow"); 324 }); 325 timelineW = $('#timelineOuter').width(); 326 timelineInnerW = $('#timelineInner').width(); 327 timelineX = parseInt($('#timelineInner').css('right')); 328 bindtimelineFunctions(); 329 $("#timelineMoveLeft").click(function(){ 330 moveTimeline(1); 331 }); 332 $("#timelineMoveRight").click(function(){ 333 moveTimeline(-1); 334 }); 335 $('.navbar-brand').on('click',function(event){ 336 event.preventDefault(); 337 $('.navbar-toggle').trigger('click'); 338 }) 339 //Home 5 340 $('.inner-header5 .close-top-adv').on('click',function(event){ 341 event.preventDefault(); 342 $('.top-header5').slideUp(); 343 }); 344 fix_height_footer_item(); 345 set_pos_megamenu(); 346 $('.filter-item-top').each(function(){ 347 if($(window).width() >= 768) $(this).find('.col-md-2 .filter-label').css('height',$(this).find('.col-md-10').outerHeight()); 348 }) 349 //Fix product variable thumb 350 $(document).on('change', 'body .variations_form select', function() { 351 var id = $('input[name="variation_id"]').val(); 352 if(id){ 353 $('.product-list-thumb .thumbnails').find('a[data-variation_id="'+id+'"]').trigger( 'click' ); 354 } 355 }) 356 // variable product 357 if($('.wrap-attr-product.special').length > 0){ 358 $(document).on('click', '.attr-filter ul li a', function() { 359 event.preventDefault(); 360 $(this).parents('ul').find('li a').removeClass('active'); 361 $(this).addClass('active'); 362 var attribute = $(this).parent().attr('data-attribute'); 363 var id = $(this).parents('ul').attr('data-attribute-id'); 364 $('#'+id).val(attribute); 365 $('#'+id).trigger( 'change' ); 366 $('#'+id).trigger( 'focusin' ); 367 return false;
368 }) 369 $('.attr-hover-box').hover(function(){ 370 var seff = $(this); 371 var old_html = $(this).find('ul').html(); 372 var current_val = $(this).find('ul li.active').attr('data-attribute'); 373 $(this).next().find('select').trigger( 'focusin' ); 374 var content = ''; 375 $(this).next().find('select').find('option').each(function(){ 376 var val = $(this).attr('value'); 377 var title = $(this).html(); 378 var el_class = ''; 379 if(current_val == val) el_class = ' class="active"'; 380 if(val != ''){ 381 if(seff.hasClass('attr-color')) content += '<li'+el_class+' data-attribute="'+val+'"><a href="#"><span class="color-'+val+'"></span></a></li>'; 382 else content += '<li'+el_class+' data-attribute="'+val+'"><a href="#">'+title+'</a></li>'; 383 } 384 }) 385 if(old_html != content) $(this).find('ul').html(content); 386 }) 387 $(document).on('click', 'body .reset_variations', function() { 388 389 390 $('.attr-hover-box').each(function(){ 391 var seff = $(this); 392 var old_html = $(this).find('ul').html(); 393 var current_val = $(this).find('ul li.active').attr('data-attribute'); 394 $(this).next().find('select').trigger( 'focusin' ); 395 var content = ''; 396 $(this).next().find('select').find('option').each(function(){ 397 var val = $(this).attr('value'); 398 var title = $(this).html(); 399 var el_class = ''; 400 if(current_val == val) el_class = ' class="active"'; 401 if(val != ''){ 402 if(seff.hasClass('attr-color')) content += '<li'+el_class+' data-attribute="'+val+'"><a href="#"><span class="color-'+val+'"></span></a></li>'; 403 else content += '<li'+el_class+' data-attribute="'+val+'"><a href="#">'+title+'</a></li>'; 404 } 405 }) 406 if(old_html != content) $(this).find('ul').html(content); 407 $(this).find('ul li').removeClass('active'); 408 }) 409 }) 410 } 411 //end 412 //Product Gallery 413 $('.pro-gal a').on('click',function(event){ 414 event.preventDefault(); 415 var src = $(this).find('img').attr('src'); 416 var srcset = $(this).find('img').attr('srcset'); 417 var title = $(this).find('img').attr('src'); 418 var alt = $(this).find('img').attr('alt'); 419 $(this).siblings().removeClass('active'); 420 $(this).addClass('active'); 421 $(this).parents('.product-thumb').find('.product-img img').attr('src',src); 422 $(this).parents('.product-thumb').find('.product-img img').attr('srcset',srcset); 423 $(this).parents('.product-thumb').find('.product-img img').attr('title',title); 424 $(this).parents('.product-thumb').find('.product-img img').attr('alt',alt); 425 }); 426 //Count item cart 427 if($("#count-cart-item").length){ 428 var count_cart_item = $("#count-cart-item").val(); 429 $(".cart-item-count").html(count_cart_item); 430 } 431 //QUANTITY CLICK 432 $("body").on("click",".quantity .qty-up",function(){ 433 var min = $(this).prev().attr("data-min"); 434 var max = $(this).prev().attr("data-max"); 435 var step = $(this).prev().attr("data-step"); 436 if(step === undefined) step = 1; 437 if(max !==undefined && Number($(this).prev().val())< Number(max) || max === undefined){ 438 if(step!='') $(this).prev().val(Number($(this).prev().val())+Number(step)); 439 } 440 $( 'div.woocommerce > form input[name="update_cart"]' ).prop( 'disabled', false ); 441 return false; 442 }) 443 $("body").on("click",".quantity .qty-down",function(){ 444 var min = $(this).next().attr("data-min"); 445 var max = $(this).next().attr("data-max"); 446 var step = $(this).next().attr("data-step"); 447 if(step === undefined) step = 1; 448 if(Number($(this).next().val()) > 1){ 449 if(min !==undefined && $(this).next().val()>min || min === undefined){ 450 if(step!='') $(this).next().val(Number($(this).next().val())-Number(step)); 451 } 452 } 453 $( 'div.woocommerce > form input[name="update_cart"]' ).prop( 'disabled', false ); 454 return false;
455 }) 456 $("body").on("keyup change","input.qty-val",function(){ 457 var max = $(this).attr('data-max'); 458 if( Number($(this).val()) > Number(max) ) $(this).val(max); 459 $( 'div.woocommerce > form input[name="update_cart"]' ).prop( 'disabled', false ); 460 }) 461 //Mini cart 462 //Count item cart 463 if($("#count-cart-item").length){ 464 var count_cart_item = $("#count-cart-item").val(); 465 $(".cart-item-count").html(count_cart_item); 466 } 467 //End mini cart 468 469 resizeTopmenu(); 470 // auto_width_megamenu(); 471 // fixed_header(); 472 // Select menu 473 $( "#category-select" ).selectmenu(); 474 475 // CATEGORY FILTER PRICE 476 $('.slider-range-price').each(function(){ 477 var min = $(this).data('min'); 478 var max = $(this).data('max'); 479 var unit = $(this).data('unit'); 480 var value_min = $(this).data('value-min'); 481 var value_max = $(this).data('value-max'); 482 var label_reasult = $(this).data('label-reasult'); 483 var t = $(this); 484 $( this ).slider({ 485 range: true, 486 min: min, 487 max: max, 488 values: [ value_min, value_max ], 489 slide: function( event, ui ) { 490 var result = label_reasult +" "+ unit + ui.values[ 0 ] +' - '+ unit +ui.values[ 1 ]; 491 $('.price-min-filter').val(ui.values[ 0 ]); 492 $('.price-max-filter').val(ui.values[ 1 ]); 493 t.closest('.block-filter-inner').find('.amount-range-price').html(result); 494 } 495 }); 496 }) 497 /// tre menu category 498 $(document).on('click','.tree-menu li',function(){ 499 $(this).toggleClass('active'); 500 $(this).children('ul').slideToggle(); 501 502 return false; 503 }) 504 // Zoom 505 if($('.easyzoom').length >0){ 506 // Instantiate EasyZoom instances 507 var $easyzoom = $('.easyzoom').easyZoom(); 508 509 // Get an instance API 510 var api1 = $easyzoom.filter('.easyzoom--with-thumbnails').data('easyZoom'); 511 512 // Setup thumbnails example 513 $('.thumbnails').on('click', 'a', function(e) { 514 $(this).closest('.product-list-thumb').find('a').each(function(){ 515 $(this).removeClass('selected'); 516 }) 517 518 $(this).addClass('selected'); 519 520 var $this = $(this); 521 e.preventDefault(); 522 // Use EasyZoom's `swap` method 523 api1.swap($this.data('standard'), $this.attr('href')); 524 var thumb = $(this).parents('.block-product-image').find('.product-image a'); 525 thumb.attr('href',$(this).attr('href')); 526 thumb.find('img').attr('src',$(this).find('img').attr('src')); 527 thumb.find('img').attr('srcset',$(this).find('img').attr('srcset')); 528 thumb.find('img').attr('title',$(this).find('img').attr('title')); 529 530 }); 531 532 // Setup toggles example 533 var api2 = $easyzoom.filter('.easyzoom--with-toggle').data('easyZoom'); 534 535 $('.toggle').on('click', function() { 536 var $this = $(this); 537 if ($this.data("active") === true) { 538 $this.text("Switch on").data("active", false); 539 api2.teardown(); 540 } else { 541 $this.text("Switch off").data("active", true); 542 api2._init(); 543 } 544 }); 545 } 546 /* Send conttact*/ 547 $(document).on('click','#btn-send-contact',function(){ 548 var subject = $('#subject').val(), 549 email = $('#email').val(), 550 order_reference = $('#order_reference').val(), 551 message = $('#message').val(); 552 var data = { 553 subject:subject, 554 email:email, 555 order_reference:order_reference, 556 message:message 557 } 558 $.post('ajax_contact.php',data,function(result){ 559 if(result.trim()=="done"){ 560 $('#email').val(''); 561 $('#order_reference').val(''); 562 $('#message').val(''); 563 $('#message-box-conact').html('<div class="alert alert-info">Your message was sent successfully. Thanks</div>'); 564 }else{ 565 $('#message-box-conact').html(result); 566 } 567 }) 568 }) 569 570 /** TOP review**/ 571 $(document).on('click','.block-top-review .product-name',function(){ 572 $(this).closest('.list-product').find('.product').each(function(){ 573 $(this).removeClass('active'); 574 }) 575 $(this).closest('.product').addClass('active'); 576 return false;
577 }) 578 /* scroll top */ 579 $(document).on('click','.scroll_top',function(){ 580 $('body,html').animate({scrollTop:0},400); 581 return false; 582 }) 583 // Top menu vetical 584 if($('.shop-menu').length >0){ 585 $(document).on('click','.shop-menu .icon',function(){ 586 $(this).closest('.shop-menu').find('.block-vertical-menu').slideToggle(); 587 }) 588 /* Close vertical */ 589 $(document).on('click','*',function(e){ 590 var container = $(".shop-menu"); 591 if (!container.is(e.target) && container.has(e.target).length === 0){ 592 container.find('.block-vertical-menu').hide(); 593 } 594 }) 595 } 596 597 }); 598 /* --------------------------------------------- 599 Scripts initialization 600 --------------------------------------------- */ 601 $(window).load(function() { 602 //Fix mailchimp 603 $('.sv-mailchimp-form').each(function(){ 604 var placeholder = $(this).attr('data-placeholder'); 605 var submit = $(this).attr('data-submit'); 606 if(placeholder) $(this).find('input[name="EMAIL"]').attr('placeholder',placeholder); 607 if(submit) $(this).find('input[type="submit"]').val(submit); 608 }) 609 //Bx Slider 610 if($('.bxslider-home6').length>0){ 611 $('.bxslider').each(function(){ 612 $(this).bxSlider({ 613 nextText: 'next', 614 prevText: 'prev', 615 auto: true 616 }); 617 }); 618 } 619 //Time Count Down Circle 620 if($('.count-down-circle').length>0){ 621 $('.count-down-circle').TimeCircles({ 622 fg_width: 0.03, 623 bg_width: 1.2, 624 text_size: 0.07, 625 circle_bg_color: "#5f6062", 626 time: { 627 Days: { 628 show: false, 629 text: "Days", 630 color: "#000" 631 }, 632 Hours: { 633 show: true, 634 text: "Hours", 635 color: "#000" 636 }, 637 Minutes: { 638 show: true, 639 text: "Mins", 640 color: "#000" 641 }, 642 Seconds: { 643 show: true, 644 text: "Seconds", 645 color: "#000" 646 } 647 } 648 }); 649 } 650 init_carousel(); 651 resizeTopmenu(); 652 kt_bxslider(); 653 auto_width_megamenu(); 654 655 // Fix price html 656 $('.price-box').each(function(){ 657 var sale_price = $(this).find('del').html(); 658 if(sale_price){ 659 $(this).find('del').remove(); 660 $(this).append('<del>'+sale_price+'</del>'); 661 } 662 }) 663 664 // count downt 665 if($('.countdown-lastest').length >0){ 666 var labels = ['Y', 'M', 'W', 'D', 'H', 'M', 'S']; 667 var layout = '<span class="box-count day"><span class="number">{dnn}</span> <span class="text">D</span></span><span class="dot">:</span><span class="box-count hrs"><span class="number">{hnn}</span> <span class="text">H</span></span><span class="dot">:</span><span class="box-count min"><span class="number">{mnn}</span> <span class="text">M</span></span><span class="dot">:</span><span class="box-count secs"><span class="number">{snn}</span> <span class="text">S</span></span>'; 668 $('.countdown-lastest').each(function() { 669 // var austDay = new Date($(this).data('y'),$(this).data('m') - 1,$(this).data('d'),$(this).data('h'),$(this).data('i'),$(this).data('s')); 670 var austDay = new Date($(this).data('date')); 671 $(this).countdown({ 672 until: austDay, 673 labels: labels, 674 layout: layout 675 }); 676 }); 677 } 678 679 // Slidder home 4 680 if($('#bxslider-home4').length >0){ 681 var slider = $('#bxslider-home4').bxSlider({ 682 nextText:'<i class="fa fa-angle-right"></i>', 683 prevText:'<i class="fa fa-angle-left"></i>', 684 auto: true, 685 onSliderLoad:function(currentIndex){ 686 $('#bxslider-home4 li').find('.caption').each(function(i){ 687 $(this).show().addClass('animated fadeInRight').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ 688 $(this).removeClass('fadeInRight animated'); 689 }); 690 }) 691 }, 692 onSlideBefore:function(slideElement, oldIndex, newIndex){ 693 slideElement.find('.sl-description').hide(); 694 slideElement.find('.caption').each(function(){ 695 $(this).hide().removeClass('animated fadeInRight'); 696 }); 697 }, 698 onSlideAfter: function(slideElement, oldIndex, newIndex){ 699 //slideElement.find('.sl-description').show(); 700 slideElement.parents('.block-slider').find('.caption-group .caption').hide(); 701 setTimeout(function(){ 702 slideElement.find('.caption').each(function(){ 703 $(this).show().addClass('animated fadeInRight').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ 704 $(this).removeClass('fadeInRight animated'); 705 }); 706 }); 707 }, 500); 708 } 709 }); 710 //slider.reloadSlider(); 711 } 712 if($('.mini-cart-list').length > 0){ 713 if($('.mini-cart-list').height() >= 260) $('.mini-cart-list').mCustomScrollbar(); 714 } 715 $(document).on('click', '.search-category', function() { 716 717 718 if(!$(this).hasClass('mCustomScrollbar')) $('#category-select-menu').mCustomScrollbar(); 719 }) 720 /* Show hide scrolltop button */ 721 if( $(window).scrollTop() == 0 ) { 722 $('.scroll_top').stop(false,true).fadeOut(600); 723 }else{ 724 $('.scroll_top').stop(false,true).fadeIn(600); 725 } 726 $("#header").css('min-height',''); 727 if($(window).width()>1024){ 728 $("#header").css('min-height',$("#header").height()); 729 fixed_header(); 730 } 731 else{ 732 $("#header").css('min-height',''); 733 } 734 if($('.rtl-enable').length > 0){ 735 $('.block3.block-new-arrivals').each(function(){ 736 var w_title = $(this).find('h3.block-title').outerWidth();
737 $(this).find('.owl-controls').css('right',w_title - 21); 738 $(this).find('.owl-controls').css('left','inherit'); 739 740 }) 741 $('.block3.block-hotdeals').each(function(){ 742 var w_title = $(this).find('h3.block-title').outerWidth(); 743 $(this).find('.owl-controls').css('left',w_title - 21); 744 745 $(this).find('.owl-controls').css('right','inherit'); 746 }) 747 } 748 else{ 749 $('.block3.block-new-arrivals').each(function(){ 750 var w_title = $(this).find('h3.block-title').outerWidth(); 751 $(this).find('.owl-controls').css('left',w_title - 21); 752 753 }) 754 $('.block3.block-hotdeals').each(function(){ 755 var w_title = $(this).find('h3.block-title').outerWidth(); 756 $(this).find('.owl-controls').css('left',w_title - 21); 757 758 }) 759 } 760 if($('.rtl-enable').length > 0&&false){ 761 $('.vc_row[data-vc-full-width="true"]').each(function(){ 762 var style = $(this).attr('style'); 763 style = style.replace("left","right"); 764 $(this).attr('style',style); 765 }) 766 $('.block-vertical-menu').each(function(){ 767 var pos_left = $(this).offset().left; 768 if(pos_left > $(window).width()/2){ 769 $(this).find('.vertical-dropdown-menu').css('left','inherit'); 770 $(this).find('.vertical-dropdown-menu').css('right','100%'); 771 } 772 }) 773 } 774 }); 775 /* --------------------------------------------- 776 Scripts resize 777 --------------------------------------------- */ 778 var w_width = $(window).width(); 779 $(window).resize(function(){ 780 resizeTopmenu(); 781 auto_width_megamenu(); 782 $('.filter-item-top').each(function(){ 783 if($(window).width() >= 768) $(this).find('.col-md-2 .filter-label').css('height',$(this).find('.col-md-10').outerHeight()); 784 }) 785 $("#header").css('min-height',''); 786 fix_height_footer_item(); 787 var c_width = $(window).width(); 788 if($('.rtl-enable').length > 0 && c_width != w_width && false){ 789 $('.vc_row[data-vc-full-width="true"]').each(function(){ 790 var style = $(this).attr('style'); 791 style = style.replace(" left:"," right:"); 792 $(this).attr('style',style); 793 }) 794 w_width = c_width; 795 } 796 }); 797 /* --------------------------------------------- 798 Scripts scroll 799 --------------------------------------------- */ 800 $(window).scroll(function(){ 801 // stick_menu(); 802 auto_width_megamenu(); 803 fixed_header(); 804 set_pos_megamenu(); 805 if($(window).width()>1024){ 806 var min_height = $("#header").css('min-height'); 807 if(min_height == '0px') $("#header").css('min-height',$("#header").height()); 808 } 809 else{ 810 $("#header").css('min-height',''); 811 } 812 /* Show hide scrolltop button */ 813 if( $(window).scrollTop() == 0 ) { 814 $('.scroll_top').stop(false,true).fadeOut(600); 815 }else{ 816 $('.scroll_top').stop(false,true).fadeIn(600); 817 } 818 }); 819 820 821 822 823 824 resizeTopmenu(); 825 826 827})(jQuery); // End of use strict
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.