jQuery(document).ready(function($) {
$('.woocommerce ul.products li.product img, .woocommerce div.product div.images img').each(function() {
var width = $(this).width();
$(this).css('height', width + 'px');
});
$(window).resize(function() {
$('.woocommerce ul.products li.product img, .woocommerce div.product div.images img').each(function() {
var width = $(this).width();
$(this).css('height', width + 'px');
});
});
});
If you are using the jQuery library, then don't forget to wrap your code inside jQuery.ready() as follows:
jQuery(document).ready(function( $ ){
// Your code in here
});
--
If you want to link a JavaScript file that resides on another server (similar to
), then please use
the "Add HTML Code" page, as this is a HTML code that links a JavaScript file.
End of comment */