function fixHeight(){ var vejska=0; var sirka=0; max_vejska=0; jQuery('.product-show-slide-content .product_box a.text strong span').each(function() { vejska=jQuery( this ).height(); sirka=jQuery( this ).width(); if(vejska>max_vejska)max_vejska=vejska; //console.log(max_vejska + jQuery(this).html()); }); jQuery('.product-show-slide-content .product_box a.text strong').height(max_vejska); //jQuery('.product-show-slide-content .product_box a.text').height(max_vejska+10); jQuery('.product-show-slide-content .product_box a.text').css("min-height", "auto"); } function replaceProductMenu() { jQuery('.display_products').find('ul').remove(); jQuery('.display_products').append(jQuery('#product_menu_replacement').html()); } jQuery(document).ready(function () { replaceProductMenu(); jQuery( ".nav-menu li.display_products" ).mouseover(function() { setTimeout(function(){ jQuery('.nav-menu .product_box a.text').matchHeight({ property: 'min-height' }); }, 50); }); jQuery(".fancy_popup").fancybox({ 'scrolling' : 'no' }); jQuery('.product_box a.text').matchHeight({ property: 'height' }); jQuery('.product_box a.text2').matchHeight({ property: 'height' }); jQuery(".nav-menu li").hover( function () { jQuery(this).children("ul.sub-menu").stop(true, true).slideDown(200); jQuery(this).addClass("current-menu-item"); }, function () { jQuery(this).children("ul.sub-menu").stop(true, true).slideUp(200); jQuery(this).removeClass("current-menu-item"); } ); jQuery(".showmenu").click(function(){ jQuery(this).toggleClass("active"); jQuery(".main-navigation").toggleClass("show"); }); jQuery(".showsearch").click(function(){ jQuery(this).toggleClass("active"); jQuery("#searchform").toggleClass("show"); }); function fixTables() { if (!tables_fixed) { if (jQuery(window).width() <= 640) { jQuery("#tab-general > table, #tab-codes > table").each(function() { var table = jQuery(this); if (jQuery(table).find("tr:first td").length > 1) { jQuery(table).addClass('table-rows'); var headings = []; jQuery(table).find("tr:first td").each(function(i){ headings[i] = '' + jQuery(this).text() + ''; }); jQuery(table).find("tr").each(function(){ var row = jQuery(this); jQuery(row).find("td").each(function(j){ jQuery(this).prepend(headings[j]); }); }); } }); tables_fixed = true; } } } var tables_fixed = false; fixTables(); jQuery(window).on('resize', function(){ fixTables(); }); jQuery("#ca_signature1").jSignature(); jQuery("#ca_signature2").jSignature(); // datepicker jQuery("#date_of_purchase").datepicker({ dateFormat: "mm/dd/yy" }); // any datepicker jQuery(".init_datepicker").each(function(){ jQuery(this).datepicker({ dateFormat: "mm/dd/yy" }) }); // product slider fixHeight(); jQuery('.product-show-slide-content').slick({ slidesToShow: 4, // default desktop values slidesToScroll: 1, rows: 2, prevArrow: jQuery('.product-slide-left'), nextArrow: jQuery('.product-slide-right'), responsive: [ { breakpoint: 1000, settings: { slidesToShow: 3, // default desktop values slidesToScroll: 1, rows: 2, prevArrow: jQuery('.product-slide-left'), nextArrow: jQuery('.product-slide-right') } }, { breakpoint: 700, settings: { slidesToShow: 2, // default desktop values slidesToScroll: 1, rows: 2, prevArrow: jQuery('.product-slide-left'), nextArrow: jQuery('.product-slide-right') } }/*, { breakpoint: 400, settings: { slidesToShow: 1, // default desktop values slidesToScroll: 1, rows: 2, prevArrow: jQuery('.product-slide-left'), nextArrow: jQuery('.product-slide-right') } }*/ // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] }); jQuery('.product-show-slide-content').on('setPosition', function () { //fixHeight(); }); jQuery(window).on('resize', function(){ setTimeout(function() { fixHeight(); }, 100); // maly zpozdeni kvuli maximalizaci kde resize nejelo }); }); jQuery(window).on('load', function(){ fixHeight(); });