(function($){ $(document).ready(function(){ $('ul.product-categories li.cat-parent, .vc_wp_custommenu ul.menu li.menu-item-has-children').each(function(){ var p = $(this), btn = $('',{'class':'showsubmenu icon-plus7', text : '' }).click(function(){ if(p.hasClass('parent-showsub')){ menu.slideUp(300,function(){ p.removeClass('parent-showsub'); }); }else{ menu.slideDown(300,function(){ p.addClass('parent-showsub'); }); } }), menu = p.children('ul') ; p.prepend(btn); // append : trong - duoi, prepend : trong - tren, after : duoi, before : tren }); $( document ).delegate( 'li.cat-parent, li.menu-item-has-children', 'aparent', function() { var e = $( this ).addClass( 'parent-showsub'); e.parent( 'ul' ).parent( 'li' ).trigger( 'aparent' ); } ); jQuery('ul.product-categories li.current-cat, .vc_wp_custommenu ul.menu ul > li[class*="current-"]').each( function() { $( this ).trigger( 'aparent' ); } ); /////////// tooltip $('[data-toggle="tooltip"]').tooltip(); ////////// Add Class $('.subcategories .product-category').each(function(){$(this).parent().parent().addClass('issubcategories');}); $('.item-btn .compare-button a').addClass('btn icon-params'); $('.current-cat.cat-parent').addClass('parent-showsub'); $('.content-item-description .addtocart, input.wpcf7-submit, .post-password-form input[type="submit"]').addClass('btn'); // $('.button').addClass('btn btn-default').removeClass('button'); $('#buddypress .ac-reply-cancel').addClass('btn btn-gray'); //$('.bp-login-widget-register-link a, .bp-login-widget-user-logout .logout').addClass('btn btn-default'); $('.item-btn .yith-wcwl-add-to-wishlist a').each(function(){ $(this).addClass('btn icon-heart-o').html(''); }); ////////// Move if ($('#jv-nav-right .jv-nav-right-content').length) { $('ul.singlemenu').appendTo("#jv-nav-right .jv-nav-right-content"); } if ($('#block-breadcrumb .container').length) { $('#page-shop-sidebar ul#breadcrumb').prependTo("#block-breadcrumb .container"); } if ($('#block-breadcrumb .container').length) { $('#maincontent h1.entry-title').prependTo("#block-breadcrumb .container"); } if ($('.woo-category').length) { $('.term-description').appendTo(".woo-category"); } if ($('.shop-info-detail .shopImages-main').length) { // $('.shop-info-detail .onsale').appendTo(".shop-info-detail .shopImages-main"); } // Remove text $(".prev.page-numbers").addClass(' icon-arrow-left10').html(""); $(".next.page-numbers").addClass(' icon-arrow-right10').html(""); // BTN Touch var $body= $('body'); $('.btn-menu-mobile').click(function(){ if($body.hasClass('show-menu-mobile')){ $body.removeClass('show-menu-mobile'); }else{ $body.addClass('show-menu-mobile'); } }); // parallax $('.sectionAboutNumbers, [class*="sectionCallout"]').parallax(); // bpopup $('body').delegate('[data-rel=bpopup]','click',function(){ $($(this).attr('href')).bPopup({closeClass:'bpopup-close'}); return false; }); /* ScrollToFixed menu */ $('#nav-mainmenu ').scrollToFixed({minWidth: 1200}); $('.shortcodeMenu').scrollToFixed({ minWidth: 768, marginTop: 78, zIndex:20}); $('.rzoom').zoom(); $( 'form[data-product_id]' ).first().on( 'wc_variation_form', function( e, c ) { $( this ).on( 'found_variation', function( e, d ) { $( this ).closest( '.product' ).find( '.zoomImg' ).each( function() { $( this ).attr( 'src', d.image_link ); } ); } ); } ); //jv-accordion numberic var acc = $('.jv-accordion.numberic .wpb_accordion_section'); for(var i=0; i< acc.length; i++){ var anchor = $(acc[i]).find('.wpb_accordion_header a'); if(anchor.length >0){ anchor.attr('data-content',i+1); } } var child = $('.woocommerce.widget_products .product_list_widget').children(); for(var i=0; i< child.length; i++){ var item = $(child[i]); if(item.length >0){ item.attr('data-id',i+1); } } //add header fixed when scroll over 70 (for adminbar visible) $(window).scroll(function(){ var sticky = $('#header'), scroll = $(window).scrollTop(); if (scroll >= 70) sticky.addClass('fixed'); else sticky.removeClass('fixed'); }); }); })(jQuery); (function(t){ t.extend(t.fn, { syncOwl: function (e) { e = t.extend({ main: { items: 1 }, sub: { items: 4, afterInit: function (e) { e.data({ items: e.find('.owl-item').each(function (e) { t(this).data({ owlItem: e }); }) }).data('items').first().addClass('active'); } } }, e), e.main.afterAction = function (t) { var e = this.currentItem, a = t.data('sub'); if( !a || !a.length ) { return; } a.data('items').removeClass('active').eq(e).addClass('active'), a.trigger('center', e); }, e.sub.afterInit = function (e) { e.data({ items: e.find('.owl-item').each(function (e) { t(this).data({ owlItem: e }); }) }).data('items').first().addClass('active'); }; var a = e.main.selector, i = e.sub.selector; return this.each(function () { var n = t(this), o = n.find(a), s = n.find(i); s.owlCarousel(e.sub).delegate('.owl-item', 'click', function (e) { e.preventDefault(), o.trigger('owl.goTo', t(this).data('owlItem')); }).on({ center: function (e, a) { var i = t(this), n = i.data('owlCarousel').owl.visibleItems, o = t.inArray(a, n) > - 1 ? 1 : 0; o ? a === n[n.length - 1] ? i.trigger('owl.goTo', n[1]) : a === n[0] && i.trigger('owl.goTo', a - 1) : a > n[n.length - 1] ? i.trigger('owl.goTo', a - n.length + 2) : (a - 1 === - 1 && (a = 0), i.trigger('owl.goTo', a)); } }), o.data({ sub: s }).owlCarousel(e.main); }); } }); })(jQuery); jQuery(function (t) { t('.inner-item').syncOwl({ main: { selector: '.imgMainProduct', transitionStyle:'goDown', singleItem : true, items: 1, autoPlay : false, stopOnHover:true }, sub: { selector: '.imgsubproduct', items: 2, itemsTablet: [768,2], itemsMobile: [479,2], navigation : true, navigationText : ["",""] } }); t('.shopImages').syncOwl({ main: { selector: '.imgMainProduct', transitionStyle:'fade', singleItem : true, items: 1 }, sub: { selector: '.imgsubproduct', items: 3, navigation: true, navigationText : ["",""], itemsDesktop :[1199,3], itemsDesktopSmall:[979,2], itemsTablet: [768,2], itemsMobile: [479,2] } }); });