-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite scroll is loading several times per request #803
Comments
Hi! Were you able to resolve this? |
Nope. |
If you're manually triggering Infinite Scroll, you may need to disable |
Not actually. Its not making any new request, and that's fine. Problem is If you see in Network tab in DevTools of chrome, you will see plugin is initializing several times (look an eye on console) on single request while switching category TABS. Check this. 'funny' is echoed 4 times which is logged
|
I was able to find a bug. See #807 (comment) Thanks for that. You should be able to re-initialize both Infinite Scroll and Masonry by first destroying both plugin instances $(document).on("click", ".reload", function(e) {
$grid.infiniteScroll('destroy');
$grid.masonry('destroy');
initMasonry();
}); See demo https://codepen.io/desandro/pen/ab2cc8162dde24c18ff12caf360d6186 However, there currently is a bug that doesn't properly remove jQuery data on // duck punch
var destroy = InfiniteScroll.prototype.destroy;
InfiniteScroll.prototype.destroy = function() {
destroy.apply( this, arguments );
// remove jQuery data
if ( jQuery && this.$element ) {
jQuery.removeData( this.element, 'infiniteScroll' );
}
}; |
Infinite Scroll v3.0.5 has been released. |
Hi, I am using the plugin and its totally fine until I tried something different.
On single page its working fine. But i want to use Pills like design.
I have 4-8 tabs (as categories) and single container. Whenever I switch tabs I used to delete all the data and and reinitialize the plugin. but with each click the initialisation is getting increased by one.
You can check the behaviour here. http://revamp.sillypicks.com/
Click on any category tab and look an eye on console window. You will see the category name being echoed 3-4 times on single click. Suppose if you click funny tab for first time, you will see 2 times funny echoing in console, try switching to some other tab and come back to funny again and you will see funny echoing 4 times on single line.
Try switching the any 2 categories tab back and forth. and see the network and results in console log.
Bellow is the JS code.
The text was updated successfully, but these errors were encountered: