Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created November 30, 2020 09:23
Show Gist options
  • Select an option

  • Save yousufansa/7fb176a4fd49dd46dea6609c53934f07 to your computer and use it in GitHub Desktop.

Select an option

Save yousufansa/7fb176a4fd49dd46dea6609c53934f07 to your computer and use it in GitHub Desktop.
Electro - Product Flicker on Product Hover Fix
if( ! function_exists( 'ec_child_product_flicker_on_hover_fix' ) ) {
function ec_child_product_flicker_on_hover_fix() {
ob_start(); ?>
(function ($) {
"use strict";
$(window).load(function(){
$('.products .product').each(function(){
$(this).css({
'min-height': $(this).height()
})
});
});
})(jQuery);
<?php
$custom_script = ob_get_clean();
wp_add_inline_script( 'electro-js', $custom_script );
}
}
add_action( 'wp_enqueue_scripts', 'ec_child_product_flicker_on_hover_fix', 30 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment