1(function($) { 2 "use strict"; 3 /* 4 ** Add Click On Ipad 5 */ 6 $(window).resize(function(){ 7 var $width = $(this).width(); 8 if( $width < 1199 ){ 9 $( '.primary-menu .nav .dropdown-toggle' ).each(function(){ 10 $(this).attr('data-toggle', 'dropdown'); 11 }); 12 } 13 }); 14 15 /* Check variable if has swatches variation */ 16 if( $('body').hasClass( 'sw-wooswatches' ) ){ 17 $( '.sw-wooswatches .product-type-variable' ).each(function(){ 18 var h_swatches = $(this).find( '.sw-variation-wrapper' ).height() + 20; 19 $(this).find( '.item-bottom' ).css( 'bottom', h_swatches ); 20 }); 21 } 22 23 /* 24 ** Blog Masonry 25 */ 26 $(window).load(function() { 27 if( $.isFunction( $.isotope ) ){ 28 $('body').find('.blog-content-grid').isotope({ 29 layoutMode : 'masonry' 30 }); 31 } 32 }); 33 34 /* 35 ** Search on click 36 */ 37 $('.header-style6 .search-cate .search-home6').on('click', function(){ 38 $('.top-form.top-search').toggleClass("open"); 39 }); 40 41 $(".search-cate .icon-search").on('click', function(){ 42 $(".search-cate .top-form").fadeToggle(); 43 $('.search-cate .icon-search').toggleClass("closex"); 44 }); 45 46 $('.header-style9 .search-home9 h3').on('click', function(){ 47 $('.top-form.top-search').toggleClass("open"); 48 }); 49 50 $('.header-style7 .vertical_megamenu .mega-left-title').on('click', function(){ 51 $('.header-style7 .vertical_megamenu').toggleClass("open"); 52 }); 53 54 $('.header-style8 .vertical_megamenu .mega-left-title').on('click', function(){ 55 $('.header-style8 .vertical_megamenu').toggleClass("open"); 56 }); 57 58 $('.header-right .menu-confirmation .text-confirmation').on('click', function(){ 59 $('.header-right .menu-confirmation').toggleClass("open"); 60 }); 61 62 $('.main-menu .header-close').on('click', function(){ 63 $('.main-menu').removeClass("open"); 64 }); 65 $('.header-open').on('click', function(){ 66 $('.main-menu').toggleClass("open"); 67 }); 68 /* 69 ** show menu mobile 70 */ 71 $('.header-menu-categories .open-menu').on('click', function(){ 72 $('.main-menu').toggleClass("open"); 73 }); 74 75 $('.footer-mstyle1 .footer-menu .footer-search a').on('click', function(){ 76 $('.top-form.top-search').toggleClass("open"); 77 }); 78 79 $('.footer-mstyle1 .footer-menu .footer-more a').on('click', function(){ 80 $('.menu-item-hidden').toggleClass("open"); 81 }); 82 83 /* 84 ** js mobile 85 */ 86 $('.single-product.mobile-layout .social-share .title-share').on('click', function(){ 87 $('.single-product.mobile-layout .social-share').toggleClass("open"); 88 }); 89 $('.single-post.mobile-layout .social-share .title-share').on('click', function(){ 90 $('.single-post.mobile-layout .social-share').toggleClass("open"); 91 }); 92 93 $('.single-post.mobile-layout .social-share.open .title-share').on('click', function(){ 94 $('.single-post.mobile-layout .social-share').removeClass("open"); 95 }); 96 97 $('.products-nav .filter-product').on('click', function(){ 98 $('.products-wrapper .filter-mobile').toggleClass("open"); 99 $('.products-wrapper').toggleClass('show-modal'); 100 }); 101 102 $('.products-nav .filter-product').on('click', function(){ 103 if( $( ".products-wrapper .products-nav .filter-product" ).not( ".filter-mobile" ) ){ 104 $('.products-wrapper').removeClass('show-modal'); 105 } 106 }); 107 108 $('.header-mobile-style5 .header-top-mobile .header-right .search-mobile').on('click', function(){ 109 $('.header-mobile-style5 .header-top-mobile .mobile-search').toggleClass('open'); 110 }); 111 112 $('.header-mobile-style5 .header-top-mobile .header-menu-categories .show_menu ').on('click', function(){ 113 $('.header-mobile-style5 .header-top-mobile .header-menu-categories .vertical_megamenu').toggleClass('open'); 114 }); 115 116 $('.mobile-layout .back-history').on('click', function(){ 117 window.history.back(); 118 }); 119 120 $('.footer-mstyle2 .footer-container .footer-open').on('click', function(){ 121 $('.footer-mstyle2').toggleClass('open'); 122 }); 123 124 $('.footer-mstyle2 .mobile_menu2') 125 .find('li:gt(7)') /*you want :gt(4) since index starts at 0 and H3 is not in LI */ 126 .hide() 127 .end() 128 .each(function(){ 129 if($(this).children('li').length > 8){ //iterates over each UL and if they have 5+ LIs then adds Show More... 130 $(this).append( 131 $('<li><a><span class="menu-title">See more</span><span class="menu-img"></span></a></li>') 132 .addClass('showMore') 133 .on('click',function(){ 134 if($(this).siblings(':hidden').length > 0){ 135 $(this).html('<a><span class="menu-title">See less</span><span class="menu-img"></span></a>').siblings(':hidden').show(400); 136 }else{ 137 $(this).html('<a><span class="menu-title">See more</span><span class="menu-img"></span></a>').show().siblings('li:gt(7)').hide(400); 138 } 139 }) 140 ); 141 } 142 }); 143 144 $('.header-style1 .header-mid .sticky-search .fa-search').on('click', function(){ 145 $('.header-style1 .header-mid .sticky-search').toggleClass("open"); 146 }); 147 148 149 $('.header-style2 .header-bottom .sticky-search .fa-search').on('click', function(){ 150 $('.header-style2 .header-bottom .sticky-search').toggleClass("open"); 151 }); 152 153 $('.header-style5 .header-bottom .sticky-search .fa-search').on('click', function(){ 154 $('.header-style5 .header-bottom .sticky-search').toggleClass("open"); 155 }); 156 157 $('.header-style14 .header-bottom .sticky-search .fa-search').on('click', function(){ 158 $('.header-style14 .header-bottom .sticky-search').toggleClass("open"); 159 }); 160 161 /* 162 ** js layout 8 163 */ 164
165 $('.header-style8 .header-bottom .sticky-search').on('click', function(){ 166 $('.header-style8 .header-mid .search-cate').slideToggle("slow"); 167 }); 168 169 /* 170 ** js layout 9 171 */ 172 173 $('.header-style9 .header-top .text-header-top .remove-banner').on('click', function(){ 174 $('.header-style9 .header-top').toggleClass("close"); 175 }); 176 177 /* 178 ** js layout 10 179 */ 180 181 $('.header-style11 .header-mid .search-icon .fa-search').on('click', function(){ 182 $('.header-style11 .header-mid .search-cate .revo_top .top-form.top-search').slideToggle(); 183 }); 184 185 /* 186 ** js layout 11 187 */ 188 189 $('.header-style10 .header-bottom .fa-search').on('click', function(){ 190 $('.header-style10 .header-bottom .sticky-search').toggleClass("open"); 191 }); 192 193 /* 194 ** js layout7 195 */ 196 197 $('.header-style7 .header-bottom .fa-search').on('click', function(){ 198 $('.header-style7 .header-bottom .sticky-search').toggleClass("open"); 199 }); 200 201 /* 202 ** js layout12 203 */ 204 205 $('.header-style12 .sw-setting').on('click', function(){ 206 $('.header-style12 .sw-setting .mid-header3').slideToggle("open"); 207 }); 208 209 $('.header-style12 .banner-close').on('click', function(){ 210 $('.header-style12 .top-banner').slideToggle("open"); 211 }); 212 213 $('.header-style12 .sticky-search i').on('click', function(){ 214 $('.header-style12 .sticky-search .sticky-search-content').slideToggle("open"); 215 }); 216 217 $('.header-style21 .banner-close').on('click', function(){ 218 $('.header-style21 .header-top').slideToggle("open"); 219 }); 220 221 /*add title to button*/ 222 $("a.compare").attr('title', custom_text.compare_text); 223 $(".yith-wcwl-add-button a").attr('title', custom_text.wishlist_text); 224 $("a.fancybox").attr('title', custom_text.quickview_text); 225 $("a.add_to_cart_button").attr('title', custom_text.cart_text); 226 227 $(document).ready(function(){ 228 $('[data-toggle="tooltip"]').tooltip(); 229 }); 230 /* 231 ** Product listing order hover 232 */ 233 $('ul.orderby.order-dropdown li ul').hide(); 234 $("ul.order-dropdown > li").each( function(){ 235 $(this).hover( function() { 236 $('.products-wrapper').addClass('show-modal'); 237 $(this).find( '> ul' ).stop().fadeIn("fast"); 238 }, function() { 239 $('.products-wrapper').removeClass('show-modal'); 240 $(this).find( '> ul' ).stop().fadeOut("fast"); 241 }); 242 }); 243 244 /* 245 ** Product listing select box 246 */ 247 $('.catalog-ordering .orderby .current-li a').html($('.catalog-ordering .orderby ul li.current a').html()); 248 $('.catalog-ordering .sort-count .current-li a').html($('.catalog-ordering .sort-count ul li.current a').html()); 249 250 /* 251 ** Quickview and single product slider 252 */ 253 $(document).ready(function(){ 254 /* 255 ** Slider single product image 256 */ 257 $( '.product-images' ).each(function(){ 258 var $rtl = $('body').hasClass( 'rtl' ); 259 var $vertical = $(this).data('vertical'); 260 var $img_slider = $(this).find('.product-responsive'); 261 var video_link = $(this).data('video'); 262 var $thumb_slider = $(this).find('.product-responsive-thumbnail' ); 263 var number_slider = ( $vertical ) ? 4: 5; 264 var number_mobile = ( $vertical ) ? 2: 4; 265 266 $img_slider.slick({ 267 slidesToShow: 1, 268 slidesToScroll: 1, 269 fade: true, 270 arrows: false, 271 rtl: $rtl, 272 asNavFor: $thumb_slider, 273 infinite: false 274 }); 275 $thumb_slider.slick({ 276 slidesToShow: number_slider, 277 slidesToScroll: 1, 278 asNavFor: $img_slider, 279 arrows: true, 280 rtl: $rtl, 281 infinite: false, 282 vertical: $vertical, 283 verticalSwiping: $vertical, 284 focusOnSelect: true, 285 responsive: [ 286 { 287 breakpoint: 480, 288 settings: { 289 slidesToShow: number_mobile 290 } 291 }, 292 { 293 breakpoint: 360, 294 settings: { 295 slidesToShow: 2 296 } 297 } 298 ] 299 }); 300 301 var el = $(this); 302 setTimeout(function(){ 303 el.removeClass("loading"); 304 var height = el.find('.product-responsive').outerHeight(); 305 var target = el.find( ' .item-video' ); 306 target.css({'height': height,'padding-top': (height - target.outerHeight())/2 }); 307 308 var thumb_height = el.find('.product-responsive-thumbnail' ).outerHeight(); 309 var thumb_target = el.find( '.item-video-thumb' ); 310 thumb_target.css({ height: thumb_height,'padding-top':( thumb_height - thumb_target.outerHeight() )/2 }); 311 }, 1000); 312 if( video_link != '' ) { 313 $img_slider.append( '<button data-type="popup" class="featured-video-button fa fa-video-camera" data-video="'+ video_link +'"></button>' ); 314 } 315 }); 316 }); 317 318 /* 319 ** Hover on mobile and tablet 320 */ 321 var mobileHover = function () { 322 $('*').on('touchstart', function () { 323 $(this).trigger('hover'); 324 }).on('touchend', function () { 325 $(this).trigger('hover'); 326 }); 327 }; 328 mobileHover(); 329 330 /* 331 ** Menu hidden 332 */ 333 $('.product-categories').each(function(){ 334 var number = $(this).data( 'number' ) - 1; 335 var lesstext = $(this).data( 'lesstext' ); 336 var moretext = $(this).data( 'moretext' ); 337 if( number > 0 ) { 338 console.log($(this).children(' >li').length); 339 $(this).find( '> li:gt('+ number +')' ).hide().end(); 340 if( $(this).children('li').length > number ){ 341 $(this).append( 342 $('<li><a>'+ moretext +' +</a></li>') 343 .addClass('showMore') 344 .on('click',function(){ 345 if($(this).siblings(':hidden').length > 0){ 346 $(this).html( '<a>'+ lesstext +' -</a>' ).siblings(':hidden').show(400); 347 }else{ 348 $(this).html( '<a>'+ moretext +' +</a>' ).show().siblings( ':gt('+ number +')' ).hide(400); 349 } 350 }) 351 ); 352 } 353 } 354 }); 355 356 357 var w_width = $(window).width(); 358 if( w_width <= 480){ 359 jQuery('.mobile-layout .header-mobile-style5 .revo_resmenu') 360 .find(' > li:gt(6) ') 361 .hide() 362 .end() 363 .each(function(){ 364 if($(this).children('li').length > 6){ 365 $(this).append( 366 $('<li><a class="open-more-cat">More Categories</a></li>') 367 .addClass('showMore') 368 .on('click', function(){ 369 if($(this).siblings(':hidden').length > 0){ 370 $(this).html('<a class="close-more-cat">Close Categories</a>').siblings(':hidden').show(400); 371 }else{ 372 $(this).html('<a class="open-more-cat">More Categories</a>').show().siblings('li:gt(6)').hide(400); 373 } 374 }) 375 ); 376 } 377 }); 378 } 379 /* 380 ** Fix accordion heading state 381 */ 382 $('.accordion-heading').each(function(){ 383 var $this = $(this), $body = $this.siblings('.accordion-body'); 384 if (!$body.hasClass('in')){ 385 $this.find('.accordion-toggle').addClass('collapsed'); 386 } 387 }); 388 389 390 /* 391 ** Cpanel 392 */ 393 $('#cpanel').collapse(); 394 395 $('#cpanel-reset').on('click', function(e) { 396 397 if (document.cookie && document.cookie != '') { 398 var split = document.cookie.split(';'); 399 for (var i = 0; i < split.length; i++) { 400 var name_value = split[i].split("="); 401 name_value[0] = name_value[0].replace(/^ /, ''); 402 403 if (name_value[0].indexOf(cpanel_name)===0) { 404 $.cookie(name_value[0], 1, { path: '/', expires: -1 }); 405 } 406 } 407 } 408 409 location.reload(); 410 }); 411 412 $('#cpanel-form').on('submit', function(e){
413 var $this = $(this), data = $this.data(), values = $this.serializeArray(); 414 415 var checkbox = $this.find('input:checkbox'); 416 $.each(checkbox, function() { 417 418 if( !$(this).is(':checked') ) { 419 name = $(this).attr('name'); 420 name = name.replace(/([^\[]*)\[(.*)\]/g, '$1_$2'); 421 var date = new Date(); 422 date.setTime(date.getTime() + (30 * 1000)); 423 $.cookie( name , 0, { path: '/', expires: date }); 424 } 425 426 }) 427 428 $.each(values, function(){ 429 var $nvp = this; 430 var name = $nvp.name; 431 var value = $nvp.value; 432 433 if ( !(name.indexOf(cpanel_name + '[')===0) ) return ; 434 435 name = name.replace(/([^\[]*)\[(.*)\]/g, '$1_$2'); 436 437 $.cookie( name , value, { path: '/', expires: 7 }); 438 439 }); 440 441 location.reload(); 442 443 return false; 444 445 }); 446 447 $('a[href="#cpanel-form"]').on( 'click', function(e) { 448 var parent = $('#cpanel-form'), right = parent.css('right'), width = parent.width(); 449 450 if ( parseFloat(right) < -10 ) { 451 parent.animate({ 452 right: '0px', 453 }, "slow"); 454 } else { 455 parent.animate({ 456 right: '-' + width , 457 }, "slow"); 458 } 459 460 if ( $(this).hasClass('active') ) { 461 $(this).removeClass('active'); 462 } else $(this).addClass('active'); 463 464 e.preventDefault(); 465 }); 466 467 /* 468 ** Language 469 */ 470 var $current =''; 471 $('#lang_sel ul > li > ul li a').on('click',function(){ 472 //console.log($(this).html()); 473 $current = $(this).html(); 474 $('#lang_sel ul > li > a.lang_sel_sel').html($current); 475 $a = $.cookie('lang_select_revo', $current, { expires: 1, path: '/'}); 476 }); 477 478 if( $.cookie('lang_select_revo') && $.cookie('lang_select_revo').length > 0 ) { 479 $('#lang_sel ul > li > a.lang_sel_sel').html($.cookie('lang_select_revo')); 480 } 481 482 $('#lang_sel ul > li.icl-ar').click(function(){ 483 $('#lang_sel ul > li.icl-en').removeClass( 'active' ); 484 $(this).addClass( 'active' ); 485 $.cookie( 'revo_lang_en' , 1, { path: '/', expires: 1 }); 486 }); 487 488 $('#lang_sel ul > li.icl-en').click(function(){ 489 $('#lang_sel ul > li.icl-ar').removeClass( 'active' ); 490 $(this).addClass( 'active' ); 491 $.cookie( 'revo_lang_en' , 0, { path: '/', expires: -1 }); 492 }); 493 494 var Revo_Lang = $.cookie( 'revo_lang_en' ); 495 if( Revo_Lang == null ){ 496 $('#lang_sel ul > li.icl-en').addClass( 'active' ); 497 $('#lang_sel ul > li.icl-ar').removeClass( 'active' ); 498 }else{ 499 $('#lang_sel ul > li.icl-en').removeClass( 'active' ); 500 $('#lang_sel ul > li.icl-ar').addClass( 'active' ); 501 } 502 503 /* 504 ** Clear header style 505 */ 506 $( '.revo-logo' ).on('click', function(){ 507 $.cookie("revo_header_style", null, { path: '/' }); 508 $.cookie("revo_footer_style", null, { path: '/' }); 509 }); 510 511 /* 512 ** Footer accordion 513 */ 514 if ($(window).width() < 768) { 515 516 $('.footer .widget_nav_menu h2.widgettitle').append('<span class="icon-footer"></span>'); 517 $('.footer .wpb_content_element .info-footer h3').append('<span class="icon-footer"></span>'); 518 519 $(".footer .widget_nav_menu h2.widgettitle").each(function(){ 520 $(this).on('click', function(){ 521 $(this).parent().find("ul.menu").slideToggle(); 522 }); 523 }); 524 525 $(".footer .wpb_content_element .info-footer h3").each(function(){ 526 $(this).on('click', function(){ 527 $(this).parent().find("ul").slideToggle(); 528 }); 529 }); 530 531 } 532 533 if ($(window).width() < 768) { 534 535 $('.footer .footer-style7 .wpb_content_element .newletter h3').append('<span class="icon-footer"></span>'); 536 537 $(".footer .footer-style7 .wpb_content_element h3").each(function(){ 538 $(this).on('click', function(){ 539 $(this).parent().find(".wrapper-footer").slideToggle(); 540 }); 541 }); 542 543 544 $('.footer .footer-home10 .wpb_content_element h3').append('<span class="icon-footer"></span>'); 545 546 $(".footer .footer-home10 .wpb_content_element h3").each(function(){ 547 $(this).on('click', function(){ 548 $(this).parent().find(".wrapper-footer").slideToggle(); 549 }); 550 }); 551 552 } 553 554 555 /* 556 ** Back to top 557 **/ 558 $("#revo-totop").hide(); 559 var wh = $(window).height(); 560 var whtml = $(document).height(); 561 $(window).scroll(function () { 562 if ($(this).scrollTop() > whtml/10) { 563 $('#revo-totop').fadeIn(); 564 } else { 565 $('#revo-totop').fadeOut(); 566 } 567 }); 568 569 $('#revo-totop').click(function () { 570 $('body,html').animate({ 571 scrollTop: 0 572 }, 800); 573 return false; 574 }); 575 /* end back to top */ 576 577 /* 578 ** Fix js 579 */ 580 $('.wpb_map_wraper').on('click', function () { 581 $('.wpb_map_wraper iframe').css("pointer-events", "auto"); 582 }); 583 584 $( ".wpb_map_wraper" ).on('mouseleave', function() { 585 $('.wpb_map_wraper iframe').css("pointer-events", "none"); 586 }); 587 588 /* 589 ** Change Layout 590 */ 591 $( window ).load(function() { 592 if( $( 'body' ).hasClass( 'tax-product_cat' ) || $( 'body' ).hasClass( 'post-type-archive-product' ) || $( 'body' ).hasClass( 'tax-dc_vendor_shop' ) ) { 593 $('.grid-view').on('click',function(){ 594 $('.list-view').removeClass('active'); 595 $('.grid-view').addClass('active'); 596 jQuery("ul.products-loop").fadeOut(300, function() { 597 $(this).removeClass("list").fadeIn(300).addClass( 'grid' ); 598 }); 599 }); 600 601 $('.list-view').on('click',function(){ 602 $( '.grid-view' ).removeClass('active'); 603 $( '.list-view' ).addClass('active'); 604 $("ul.products-loop").fadeOut(300, function() { 605 jQuery(this).addClass("list").fadeIn(300).removeClass( 'grid' ); 606 }); 607 }); 608 /* End Change Layout */ 609 } 610 }); 611 $(window).scroll(function() { 612 var whtop = $(window).scrollTop(); 613 if (whtop > 0) { 614 $(".header-style4").addClass("header-ontop"); 615 } else { 616 $(".header-style4").removeClass("header-ontop"); 617 } 618 }); 619 620 /*remove loading*/ 621 $(".sw-woo-tab").fadeIn(300, function() { 622 var el = $(this); 623 setTimeout(function(){ 624 el.removeClass("loading"); 625 }, 1000); 626 }); 627 $(".responsive-slider").fadeIn(300, function() { 628 var el = $(this); 629 setTimeout(function(){ 630 el.removeClass("loading"); 631 }, 1000); 632 }); 633}(jQuery)); 634 635/* 636** Check comment form 637*/ 638function submitform(){ 639 if(document.commentform.comment.value=='' || document.commentform.author.value=='' || document.commentform.email.value==''){ 640 alert('Please fill the required field.'); 641 return false; 642 } else return true; 643} 644(function($){ 645 646 /*Verticle Menu*/ 647 if( !( $('#header').hasClass( 'header-style7' ) ) ) { 648 $('.vertical-megamenu').each(function(){ 649 var number = $(this).parent().data( 'number' ) - 1; 650 var lesstext = $(this).parent().data( 'lesstext' ); 651 var moretext = $(this).parent().data( 'moretext' ); 652 $(this).find( ' > li:gt('+ number +')' ).hide().end(); 653 if($(this).children('li').length > number ){ 654 $(this).append( 655 $('<li><a class="open-more-cat">'+ moretext +'</a></li>') 656 .addClass('showMore') 657 .on('click', function(){ 658 if($(this).siblings(':hidden').length > 0){ 659 $(this).html('<a class="close-more-cat">'+ lesstext +'</a>').siblings(':hidden').show(400); 660 }else{ 661 $(this).html('<a class="open-more-cat">'+ moretext +'</a>').show().siblings( ':gt('+ number +')' ).hide(400); 662 } 663 }) 664 ); 665 } 666 }); 667 } 668 669 670 $(".widget_nav_menu li.menu-compare a").hover(function() { 671 $(this).css('cursor','pointer').attr('title', custom_text.compare_text); 672 }, function() { 673 $(this).css('cursor','auto'); 674 }); 675 $(".widget_nav_menu li.menu-wishlist a").hover(function() { 676 $(this).css('cursor','pointer').attr('title', custom_text.wishlist_text); 677 }, function() { 678 $(this).css('cursor','auto'); 679 }); 680 681 var w_width = $(window).width(); 682 if( $('#header' ).hasClass('header-style7') && w_width >= 1024 ){ 683 684 function h7_vertical_align(){ 685 var w_height = $(window).outerHeight(); 686 var h7_vtarget = $('.header-style7 .vertical_megamenu .wrapper_vertical_menu' ); 687 var h7_offset = w_height - h7_vtarget.height();
688 return h7_vtarget.parents( '.vertical_megamenu' ).css( 'top', ( h7_offset/2 + 50 ) ); 689 } 690 $(document).ready(function(){ 691 h7_vertical_align(); 692 }); 693 694 $(window).on('resize', function(){ 695 h7_vertical_align(); 696 }); 697 var h7_rtl = $('body').hasClass('rtl'); 698 $('.header-style7 .vertical_megamenu .mega-left-title').on( 'click', function(e) { 699 var parent = $('.header-style7 .vertical_megamenu'); 700 var width = parent.width(); 701 if( !h7_rtl ){ 702 left = parent.css('left'); 703 if ( parseFloat(left) < -10 ) { 704 parent.animate({ 705 left: '0px', 706 }, "slow"); 707 parent.find( ' .mega-left-title' ).animate({ 708 left: width , 709 }, "slow"); 710 } else { 711 parent.animate({ 712 left: '-' + width , 713 }, "slow"); 714 parent.find( ' .mega-left-title' ).animate({ 715 left: '0px', 716 }, "slow"); 717 } 718 }else{ 719 right = parent.css('right'); 720 if ( parseFloat(right) < -10 ) { 721 parent.animate({ 722 right: '0px', 723 }, "slow"); 724 parent.find( ' .mega-left-title' ).animate({ 725 right: width , 726 }, "slow"); 727 } else { 728 parent.animate({ 729 right: '-' + width , 730 }, "slow"); 731 parent.find( ' .mega-left-title' ).animate({ 732 right: '0px', 733 }, "slow"); 734 } 735 } 736 if ( $(this).hasClass('active') ) { 737 $(this).removeClass('active'); 738 } 739 e.preventDefault(); 740 }); 741 } 742 743 $(window).scroll(function() { 744 if( $( 'body' ).hasClass( 'mobile-layout' ) ) { 745 var target = $( '.mobile-layout #header-page' ); 746 var sticky_nav_mobile_offset = $(".mobile-layout #header-page").offset(); 747 if( sticky_nav_mobile_offset != null ){ 748 var sticky_nav_mobile_offset_top = sticky_nav_mobile_offset.top; 749 var scroll_top = $(window).scrollTop(); 750 if ( scroll_top > sticky_nav_mobile_offset_top ) { 751 $(".mobile-layout #header-page").addClass('sticky-mobile'); 752 }else{ 753 $(".mobile-layout #header-page").removeClass('sticky-mobile'); 754 } 755 } 756 } 757 }); 758 var w_width = $(window).width(); 759 if( $('#header' ).hasClass('header-style8') && w_width >= 1024 ){ 760 761 function h8_vertical_align(){ 762 var w_height = $(window).outerHeight(); 763 var h8_vtarget = $('.header-style8 .vertical_megamenu .wrapper_vertical_menu' ); 764 var h8_offset = w_height - h8_vtarget.height(); 765 return h8_vtarget.parents( '.vertical_megamenu' ).css( 'top', ( h8_offset/2 + 50 ) ); 766 } 767 $(document).ready(function(){ 768 h8_vertical_align(); 769 }); 770 771 $(window).on('resize', function(){ 772 h8_vertical_align(); 773 }); 774 var h8_rtl = $('body').hasClass('rtl'); 775 $('.header-style8 .vertical_megamenu .mega-left-title').on( 'click', function(e) { 776 var parent = $('.header-style8 .vertical_megamenu'); 777 var width = parent.width(); 778 if( !h8_rtl ){ 779 left = parent.css('left'); 780 if ( parseFloat(left) < -10 ) { 781 parent.animate({ 782 left: '0px', 783 }, "slow"); 784 parent.find( ' .mega-left-title' ).animate({ 785 left: width , 786 }, "slow"); 787 } else { 788 parent.animate({ 789 left: '-' + width , 790 }, "slow"); 791 parent.find( ' .mega-left-title' ).animate({ 792 left: '0px', 793 }, "slow"); 794 } 795 }else{ 796 right = parent.css('right'); 797 if ( parseFloat(right) < -10 ) { 798 parent.animate({ 799 right: '0px', 800 }, "slow"); 801 parent.find( ' .mega-left-title' ).animate({ 802 right: width , 803 }, "slow"); 804 } else { 805 parent.animate({ 806 right: '-' + width , 807 }, "slow"); 808 parent.find( ' .mega-left-title' ).animate({ 809 right: '0px', 810 }, "slow"); 811 } 812 } 813 if ( $(this).hasClass('active') ) { 814 $(this).removeClass('active'); 815 } 816 e.preventDefault(); 817 }); 818 } 819 820 821 /* 822 ** Ajax login 823 */ 824 $('form#login_ajax').on('submit', function(e){ 825 var target = $(this); 826 var usename = target.find( '#username').val(); 827 var pass = target.find( '#password').val(); 828 if( usename.length == 0 || pass.length == 0 ){ 829 target.find( '#login_message' ).addClass( 'error' ).html( custom_text.message ); 830 return false; 831 } 832 target.addClass( 'loading' ); 833 $.ajax({
834 type: 'POST', 835 dataType: 'json', 836 url: custom_text.ajax_url, 837 headers: { 'api-key':target.find( '#woocommerce-login-nonce').val() }, 838 data: { 839 'action': 'revo_custom_login_user', //calls wp_ajax_nopriv_ajaxlogin 840 'username': target.find( '#username').val(), 841 'password': target.find( '#password').val(), 842 'security': target.find( '#woocommerce-login-nonce').val() 843 }, 844 success: function(data){ 845 target.removeClass( 'loading' ); 846 target.find( '#login_message' ).html( data.message ); 847 if (data.loggedin == false){ 848 target.find( '#username').css( 'border-color', 'red' ); 849 target.find( '#password').css( 'border-color', 'red' ); 850 target.find( '#login_message' ).addClass( 'error' ); 851 } 852 if (data.loggedin == true){ 853 target.find( '#username').removeAttr( 'style' ); 854 target.find( '#password').removeAttr( 'style' ); 855 document.location.href = data.redirect; 856 target.find( '#login_message' ).removeClass( 'error' ); 857 } 858 } 859 }); 860 e.preventDefault(); 861 }); 862 863 864 /* 865 ** Responsive Menu 866 */ 867 $( '.resmenu-container-sidebar .more-menu > a' ).on( 'click', function(e){ 868 $(this).parent().find( '>ul' ).toggle(); 869 e.preventDefault(); 870 }); 871})(jQuery); 872 873jQuery(document).ready(function ($) { 874 $('.header-style9 .header-top .text-header-top .remove-banner').on('click', function(){ 875 $('.header-style9 .header-top').toggleClass("hidden"); 876 }); 877});
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.