// JavaScript Document // Height title product (function($){ /*var fn = function(){ lists.each(function(){ var $this = $(this), titles = $this.find('li.hikashop_product .hikashop_product_name'), maxHeight = 0; ; titles.each(function(){ var title = $(this); title.css('height',''); var thisHeight = title.height(); if(maxHeight < thisHeight) maxHeight = thisHeight; }); titles.height(maxHeight); }); } var lists; $(function(){ lists = $('.latest_top, .content_home, #content'); setTimeout(fn,0); }); $(window).bind('load resize',fn);*/ $.extend($.fn, { alignHeight: function(){ var items = this, h = []; /* Get height */ items.each(function(){ var t = $(this).css({height: "auto"}); h.push(t.outerHeight(true)); t.on({ 'setHeight': function(e, data){ t.css({height: data}); } }) }); /* Set height */ h = Math.max.apply(Math, h); items.each(function(){ $(this).trigger('setHeight', [h]); }); return items; } }) })(jQuery); // View list product (function($){ $(function(){ var panel = $('#main-content #content .viewListProducts .hikashop_products'), swicher = $('.set-col').each(function(){ var t = $(this).click(function(){ if(t.hasClass('selected'))return false; panel.removeClass(swicher.not(t.addClass('selected')).removeClass('selected').data('style')).addClass(t.data('style')); }) }); /* */ $('.latest_top li.hikashop_product .hikashop_product_name').alignHeight(); $('.content_home li.hikashop_product .hikashop_product_name').alignHeight(); $('#content li.hikashop_product .hikashop_product_name').alignHeight(); }); })(jQuery); // Height item list product (function($){ jQuery(window).bind('load resize',function(){ jQuery('ul.hikashop_products').each(function(){ var p = jQuery(this), childs = p.children('.hikashop_products li.hikashop_product') ; var max = getMax(childs); childs.css('height',max); }); }); function getMax(arr){ var max = 0; arr.each(function(){ var curent = jQuery(this).height('auto').outerHeight(); max = curent > max?curent:max; }) return max; } })(jQuery); // Show or hide button (function($){ $(document).ready(function(){ $('.hikashop_cart_input_button').each(function(){ el = $(this); if (el.length && !el.parent('.line_hikashop_cart_input_button').length) { el.wrap( "" ); }; }); $('#login-form .pretext').click(function(){ if($('#login-form .userdata').is(':hidden')) $('#login-form .userdata').show(); else $('#login-form .userdata').hide(); }); $('#block-bottomb .hikashop_subcategories > ul').flexisel({ visibleItems: 5, animationSpeed: 200, autoPlay: true, autoPlaySpeed: 3000, pauseOnHover: true, enableResponsiveBreakpoints: true, responsiveBreakpoints: { portrait: { changePoint:480, visibleItems: 1 }, landscape: { changePoint:640, visibleItems: 2 }, tablet: { changePoint:768, visibleItems: 3 }, large: { changePoint:992, visibleItems: 3 }, deskatop: { changePoint:1200, visibleItems: 4 } } }); $('.latestproducts .jcarousel.hikashop_products').flexisel({ visibleItems: 4, animationSpeed: 200, autoPlay: false, autoPlaySpeed: 3000, pauseOnHover: true, enableResponsiveBreakpoints: true, responsiveBreakpoints: { portrait: { changePoint:380, visibleItems: 1 }, landscape: { changePoint:640, visibleItems: 2 }, tablet: { changePoint:768, visibleItems: 3 }, large: { changePoint:992, visibleItems: 3 }, deskatop: { changePoint:1200, visibleItems: 4 } } }); }); })(jQuery);