Last active
April 2, 2025 08:32
-
-
Save railmedia/ac4542b97bec3c3cbd7ec64553a8f184 to your computer and use it in GitHub Desktop.
Resize products
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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