Only sync siblings.
simonseddon opened this issue · 3 comments
simonseddon commented
Is there a way to restrict syncing the height of elements to just the tallest sibling?
At the moment I have elements being matched in a few different sections of the page, but they're all being set to the tallest matching element page-wide (sibling or not).
krilor commented
I haven't done any tests, but it seems to me that a solution for this would be to use some sort of jQuery selector-function combination that only pass a set of siblings to the script. Maybe something like this:
$(window).load(function(){
$('.parent').each( function() {
$(this).children('.child').syncHeight({ 'updateOnResize': true});
});
});
ginader commented
Thank you @simonseddon for the good question and to @krilor for the perfect answer! See the new example code here and running here
simonseddon commented