Recalculate based on click event
Is it possible to recalculate the height(s) based on a click event? We're using ul tabs and one of the tabs is quite long so it overflows into the div below.
If I could add a click event JS when the tab is clicked/change to recalculate would be fantastic.
What a great thing matchHeight is by the way! I love it!
Kind regards Liam
See the readme on Manually triggering an update.
I've tried what was provided but I don't seem to be able to get it to work.
I use the following which works perfectly for setting on page load:
jQuery(document).ready(function(){
jQuery(function() {
jQuery('.match_height').matchHeight();
});
});
We have tried a few different ways of recalculating from the documentation but nothing seems to work. Any chance you can provide me with the line to use based on the following?
jQuery( ".x-nav-tabs li" ).click(function() { // update JS goes here });
Kind regards Liam
$.fn.matchHeight._update()
@netfuelltd have you made it work? i have a similar problem too but in my case its accordion @liabru when the accordion open it extends and it should be still same height with other parent divs
I am not able to make it work either. Any tips?
I am having a similar issue, when I call $.fn.matchHeight._apply(myElements); via a jQuery click event, it does not work - but if I click the link a second time, it does work. Any idea why? My code:
var filteredItems = $('.item').find('.filtered-class');
$('ul.filter-menu li').bind('click', function(e) {
$.fn.matchHeight._apply(filteredItems);
});