The difference between these two functions is simply that initEqualHeights() will set up all the events for recalculating the heights when the window is resized or the global equalheights event is triggered, but equalizeTheHeights() will simply equalize the heights without involving any events.

Both functions take three optional arguments, the minimum height (number of pixels), maximum height, and the breakpoint (below which the heights will revert to their original size):

When entering a selector on the settings page or using the initEqualHeights() method this plugin also adds an event ‘equalheights’ to the window, allowing you to easily trigger the equalizing manually. This is useful if you have added new items to the page after it loads via AJAX. You can trigger the event like this:

jQuery( window ).trigger( 'equalheights' );

Another option for controlling which elements get equalized is the equal_height_columns_elements filter. This filter operates on the array of data that gets passed to the JS right before it is passed. This allows for developers to specify selectors that can’t be deleted from the settings page, and for programmaticly building selectors based on dynamic data. Here’s an example of how the filter can be used:

The keys on the element-groups array used by selectors entered on the settings page will come in as numbered indexes, so to avoid collision it’s best to use named keys for any custom selectors (we’re using ‘custom’ in the example above, but any unique string will work).

Képernyőmentések

Telepítés

Manual Installation

Upload the entire /equal-height-columns directory to the /wp-content/plugins/ directory.

Activate Equal Height Columns through the ‘Plugins’ menu in WordPress.

GYIK

Is this plugin fully responsive?

Yes! When the function runs it creates event listeners for the window resize and orientationchange events and recalculates the heights after those events trigger. You can also specify a breakpoint under which the function will not affect the heights, allowing you to equalize the heights for larger screens but leave smaller screens unaffected.

Does the plugin support multiple collections of items that get equalized independently?

Yes! From the settings page you can enter as many selectors as you’d like, giving you the ability to equalize the heights of an unlimited number of items.

What if I am dynamically adding elements to the page after it loads?

The jQuery script uses the selector to always grab the items fresh from the DOM in its current state, so as long as the selector matches the newly added elements they will get included in the calculation. You can trigger the equalizing manually at any time (such as after new content has been added via AJAX) by triggering the ‘equalheights’ event on the window like this:

jQuery( window ).trigger( 'equalheights' );

Or if you’d prefer to just trigger the equalizing of the heights without involving any events, you can call the equalizeTheHeights() method directly like this:

This is my dream come true. I spent several hours trying to get this to work via manual coding and could not get a cross-browser solution. I installed this plugin, changed ONE setting, and I'm done. Under 5 minutes, start to finish. Holy smokes. THANK YOU!!

Thanks!
This plugin is really great and simple to use.
Wasted a LOT of time trying to get same height columns in a row using SiteOrigin Page Builder: no solutions working in all cases except this plugin.
My best regards to developers!