websolutions / equal-heights

Simple, responsive equal heights plugin for jQuery.
http://design.wsoldev.com/patterns/equal-heights/
0 stars 0 forks source link

Heights don't adjust on resize #2

Open nickmelville opened 9 years ago

nickmelville commented 9 years ago
$(window).on("debouncedresize.wsol.equalHeights", base.equalize);

should be a throttled resize event (perhaps based on http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/), but currently isn't doing anything.

nickmelville commented 9 years ago

Also, line 39 looks like it has an error with the same event:

$(window).off(".wsol.equalHeights");
nickmelville commented 9 years ago

Whoops, was including 'throttledresize' but not 'debouncedresize'.

Still looking at the destroy method separately.

nickmelville commented 9 years ago

Ugh, what a mess this issue is already...

The initial issue wasn't really an issue, just a mistake I made setting up the test.

However, there is an issue with resizing and destroying when there are multiple "groups" of elements that are configured. Updated test page to demonstrate this.

Currently, we have an "unequalHeights" function rather than destroying, and each "group" is instantiated separately with separate event handlers. We should be able to merge these two approaches to handle situations where equal heights are dynamically adjusted (some toggling on and off at various breakpoints, etc.) with this component.