ginader/syncHeight

Only sync siblings.

simonseddon opened this issue · 3 comments

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).

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});
    });

});

Thank you @simonseddon for the good question and to @krilor for the perfect answer! See the new example code here and running here