Created
February 1, 2018 18:11
-
-
Save elpuas/41e57caf4c7bb96362789c1c28f16513 to your computer and use it in GitHub Desktop.
Add equal height to columns
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
| var whiteBackground = $('.mdo--servicesChild__js--selector'); | |
| if( whiteBackground.length > 0 ) { | |
| // console.log('Si Existe'); | |
| // Select and loop the container element of the elements you want to equalise | |
| whiteBackground.each(function(){ | |
| // Cache the highest | |
| var highestBox = 0; | |
| // Select and loop the elements you want to equalise | |
| $('.wpb_wrapper', this).each(function(){ | |
| console.log(this); | |
| // If this box is higher than the cached highest then store it | |
| if($(this).height() > highestBox) { | |
| highestBox = $(this).height(); | |
| // console.log(highestBox); | |
| } | |
| }); | |
| // Set the height of all those children to whichever was highest | |
| $('.mdo--servicesChild__js--selector:first-child > .wpb_wrapper').css({"height" : (highestBox + "px")}); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment