$.fn update not firing
See original GitHub issueI have a group which has content appended to it via AJAX. At the end of the images loading in the group, I show the content.
If I use: $('.blocks').matchHeight(true);
it works perfectly fine.
If I use: $('.blocks').matchHeight(true);
outside of the $.ajax call and try utilizing $.fn.matchHeight._update();
to trigger an update when the content is shown, it doesn’t fire.
I have a few other areas where the content is dynamically adjusted and I’d like to have the matchHeight updated but as of now, I can’t do that. I assume sprinkling .matchHeight(true);
's everywhere is probably not the greatest option, so hopefully, I’m just missing something painfully obvious. 😄
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Fortnite down? Current problems and outages - Downdetector
Real-time problems for Fortnite. Is the server down? Can't log in? Here you see what is going on.
Read more >Fortnite Stuck on Checking for Updates, Why is Fortnite Not ...
Players are reporting that Fortnite is not working and that they're stuck on checking for updates on February 1st, 2022.
Read more >How to Fix "LIBRARY-IN-NOSIGNATURES" Error on Fortnite ...
Chances are that you're not going to have much lucky playing Fortnite on Android until a fresh update or 'hotfix' is rolled out...
Read more >Fortnite Status (@FortniteStatus) / Twitter
We'll provide an update when we have more information. ... We're investigating an issue where the Prop Mover is not working correctly when...
Read more >Fortnite: Update v22.00 Downtime - Server Not Responding ...
Server not responding. Iv reset my internet and it's working fine but still cannot get onto Fortnite no matter how many times I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think the problem here may be a misunderstanding of how the plugin works.
When you call the
_update()
function, it will only update the original elements that you have previously appliedmatchHeight
to. Any new elements matching any previously used selectors will not be included because it does not update the set of selected elements.Instead you need to create a new selection that includes the new element and remove the old one.
Here is an example:
I hope that clears things up.
If this still doesn’t solve the problem you guys are having, please provide more information and an example. Thanks.
Hi, I am not having any luck with the following code. I am using a jQuery load more button to load new items (.suitec11-item), but the newly added items are not resizing. The live page is: http://chameleonmethod.com/suite-c11
// MANUALLY CALL MATCHHEIGHT ON SUITEC11 ITEMS jQuery(document).ready(function(){ jQuery('.suitec11-mh').matchHeight(); }); // LOAD MORE POSTS jQuery(document).ready(function(){ jQuery('.load_more a').live('click', function(e){ e.preventDefault(); var link = jQuery(this).attr('href'); jQuery('.load_more').html('<span class="loader">Loading More Posts...</span>'); jQuery.get(link, function(data) { var post = jQuery("#suitec11-sec-two .suitec11-item-wrap", data); jQuery('#suitec11-sec-two .container .row').append(post); }); // remove matchHeight on items, which includes the new element jQuery('.suitec11-mh').matchHeight({ remove: true }); // apply matchHeight on the new selection, which includes the new element jQuery('.suitec11-mh').matchHeight(); jQuery('.load_more').load(link+' .load_more a'); }); });
Any help is much appreciated!