(function($) { "use strict"; //Combobox drop down style $(".custom-dropdown, .orderby, .per_page").selectbox({ effect: "slide" }); $('.subcategories-list').click(function(event) { $('#product-sidebar').toggleClass('active'); }); $('#icon-grid').click(function(event) { if (!$(this).hasClass('active')) { $(this).addClass('active'); }; }); $('#icon-list').click(function(event) { if (!$(this).hasClass('active')) { $(this).addClass('active'); }; }); $('.humberger-button button').click(function(event) { $('#menu-humberger').toggleClass('active-menu'); $('section').toggleClass('active-menu'); $('header').toggleClass('active-menu'); $('footer').toggleClass('active-menu'); $('body').toggleClass('active-menu'); $('.mobile-menu').toggleClass('mobile-show'); $('.menu-fix-all').toggleClass('active-menu'); $('.with-widget').toggleClass('active-menu'); }); $('#menu-mb').click(function(event) { $('.mobile-menu').toggleClass('mobile-show'); $('body').toggleClass('active-menu'); }); //stick menu home 7 var home07 = $(".left-full"); var checkpos07 = home07.position(); var checkbottom = $('#bottom-scroll').position(); if(checkpos07!=undefined){ var pos07 = checkpos07.top; if(checkbottom!=undefined){ var bottom = checkbottom.top; } $(window).scroll(function() { var windowpos = $(window).scrollTop(); if (windowpos >= (pos07)) { $("#list-cat-scroll").addClass("stick-list-cat-scroll"); } else { $("#list-cat-scroll").removeClass("stick-list-cat-scroll"); $("#list-cat-scroll").removeClass("stick-list-cat-scroll-after"); } if (windowpos < bottom) { $("#list-cat-scroll").removeClass("stick-list-cat-scroll-after"); } if (windowpos >= (bottom)) { // $("#list-cat-scroll").removeClass("stick-list-cat-scroll"); //console.log(windowpos) if (!$("#list-cat-scroll").hasClass('stick-list-cat-scroll-after')) { $("#list-cat-scroll").css({ 'margin-top': parseInt(windowpos-600)+'px', }); }; } if(windowpos<1){ $("#list-cat-scroll").removeClass("stick-list-cat-scroll"); } }); } //For center modal function centerModal() { $(this).css('display', 'block'); var $dialog = $(this).find(".modal-content"); var offset = ($(window).height() - $dialog.height()) / 2; // Center modal vertically in window $dialog.css("margin-top", offset); } $('.modal').on('show.bs.modal', centerModal); //smoth scroll var $window = $(window); //Window object var scrollTime = 0.3; //Scroll time var scrollDistance = 120; //Distance. Use smaller value for shorter scroll and greater value for longer scroll $window.on("mousewheel DOMMouseScroll", function(event){ event.preventDefault(); var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; var scrollTop = $window.scrollTop(); var finalScroll = scrollTop - parseInt(delta*scrollDistance); TweenMax.to($window, scrollTime, { scrollTo : { y: finalScroll, autoKill:true }, ease: Power1.easeOut, //For more easing functions see http://api.greensock.com/js/com/greensock/easing/package-detail.html autoKill: true, overwrite: 5 }); }); //Adtocart number increase $('.add_to_cart_button').click(function(event) { var currentNumber = $('.icon-cart-ajax').html(); $('.icon-cart-ajax').html(parseInt(currentNumber)+1); }); //Addto cart number descre $('.festi-cart-remove-product').click(function(event) { var currentNumber = $('.icon-cart-ajax').html(); $('.icon-cart-ajax').html(parseInt(currentNumber)-1); }); })(jQuery);