Skip to content

Instantly share code, notes, and snippets.

@railmedia
Last active April 2, 2025 08:32
Show Gist options
  • Select an option

  • Save railmedia/ac4542b97bec3c3cbd7ec64553a8f184 to your computer and use it in GitHub Desktop.

Select an option

Save railmedia/ac4542b97bec3c3cbd7ec64553a8f184 to your computer and use it in GitHub Desktop.
Resize products
JS
(function($){
function resizeElements() {
let height = 0;
jQuery('.products li').each(function(idx, product){
if( jQuery(this).height() > height ) {
height = jQuery(this).height();
}
});
jQuery('.products li').css('height', height + 'px');
jQuery('.products li button.woosw-btn').css({position: 'absolute', bottom: 0});
}
jQuery(function(){
setTimeout( function() {
resizeElements();
}, 500 );
});
jQuery(window).on('resize', function() {
resizeElements();
});
})(jQuery);
CSS
.products li {
position: relative;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment