Server : Apache/2 System : Linux vps.sdns.vn 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64 User : phatdatpq ( 1022) PHP Version : 7.2.34 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/phatdatpq/public_html/wp-content/themes/dien-may-xanh/myattr/assets/js/ |
Upload File : |
jQuery(window).load(function() { var isures_radio_variable_height = jQuery(".isures-radio-variable").height(); //alert(isures_radio_variable_height); if( jQuery(".isures-radio-variable .isures-option").length){ var max_height = 0; jQuery(".isures-radio-variable .isures-option span.option-child").each(function() { var current_height = jQuery(this).height(); if(max_height < current_height){ max_height = current_height; } }); jQuery(".isures-radio-variable .isures-option span.option-child").css("height", max_height+"px"); jQuery(".isures-radio-variable .isures-option span.option-child").css("min-height", max_height+"px"); var equal_height = isures_radio_variable_height + max_height; //alert(equal_height); //jQuery(".isures-radio-variable .isures-option").css("height", equal_height+"px"); //jQuery(".isures-radio-variable .isures-option").css("min-height", equal_height+"px"); } }); jQuery(document).ready(function() { jQuery('.isures-radio-variable input').change(function() { jQuery('select[name="' + jQuery(this).attr('name') + '"]').val(jQuery(this).val()).trigger('change'); }); jQuery(".reset_variations").click(function() { jQuery(".isures-radio-variable input").removeAttr("checked"); jQuery(".isures-option").removeClass("active"); }); jQuery('.isures-radio-variable input').each(function(index, element) { jQuery(element).removeAttr('disabled'); let thisName = jQuery(element).attr('name'); let thisVal = jQuery(element).attr('value'); if (jQuery('select[name="' + thisName + '"] option[value="' + thisVal + '"]').is(':disabled')) { jQuery(element).prop('disabled', true); } }); jQuery('.isures-option').each(function() { let checked = jQuery(this).find('input[type="radio"]').attr("checked"); if (checked == "checked") { jQuery(this).addClass('active'); } }); jQuery( '.variations_form' ).each( function() { jQuery(this).on( 'found_variation', function( event, variation ) { console.log(variation);//all details here var price_html = variation.price_html;//selectedprice jQuery('.product-price-container .price-wrapper').html(price_html); }); }); jQuery(".isures-radio-variable").each(function() { let btn = jQuery(this).find(".isures-option"); let rep_parent_check = jQuery(this).parents(".product-small.box"); jQuery(btn).click(function() { let data_thumb = jQuery(this).find('input[type="radio"]').attr("data_thumb"); let data_url_attr = jQuery(this).find('input[type="radio"]').attr("data_link_variable"); let atc_ajax = jQuery(this).find('input[type="radio"]').attr("data_variable_id"); //let variations_data = jQuery('form.variations_form').data('product_variations'); //alert(variations_data.attributes.length); btn.removeClass("active"); jQuery(this).addClass("active"); jQuery(rep_parent_check).each(function() { let img_thumb = jQuery(this).find(".attachment-woocommerce_thumbnail"); let permalink = jQuery(this).find(".image-fade_in_back > a"); let add_to_cart = jQuery(this).find(".add-to-cart-button > a.add_to_cart_button:not(.added)"); img_thumb.attr("src", data_thumb) img_thumb.attr("srcset", data_thumb) permalink.attr("href", data_url_attr); add_to_cart.attr("href", '?add-to-cart=' + atc_ajax); add_to_cart.attr("data-product_id", atc_ajax); add_to_cart.html('Mua ngay'); add_to_cart.addClass("ajax_add_to_cart"); }); }); }); if(url_button_var =='on'){ let btn_link = jQuery(this).find("a.isures-option_link"); jQuery(btn_link).each(function() { jQuery(this).click(function(){ window.location.href = jQuery(this).attr('href'); }); }); } if(jQuery('.isures-radio-variable.scroll-on')){ jQuery('.isures-radio-variable.scroll-on').each(function() { /* jQuery(this).flickity({ // options cellAlign: 'left', contain: true, adaptiveHeight : true, autoplay:true, arrows: true, prevArrow: jQuery('.slick-prev'), nextArrow: jQuery('.slick-next'), pageDots: false }); */ });} // let elementClicked; // jQuery(".isures-option").click(function() { // elementClicked = true; // }); // if (elementClicked != true) { // alert("element not clicked"); // } else { // alert("element clicked"); // } });