Comments (11)
Thanks!! Tested and it works as planned!
from infinite-scroll.
Tested, and mostly works. I've noticed if I reach the end of one Infinite Scroll, it won't initiate any other. I'll have a look at this today.
from infinite-scroll.
Found the bug. Once you've finished scrolling, props.isDone and props.isDuringAjax don't get reset for the next instance of the infinite scroll.
A potential fix might be to change isDone and isDuringAjax to be options instead of properties, so that they can be indexed with each instance of the Infinite Scroll. I'll take a crack at this today and see what I come up with.
from infinite-scroll.
Okay, I've resolved this...somewhat. I was getting $(document).ajaxError to fire for each instance of the scroll I had gone through, so I built in a temporary fix that determines if that opts.isDone has already been declared true.
This means that .ajaxError still fires 3 times if you're finishing your third instance of scrolling to the bottom, but at least it doesn't go through the rest of the code unnecessarily. That's why I would consider it to be a temporary fix, until someone can figure out how to properly unbind it.
Here's my revision.
http://lukeshumard.com/misc/infinite-scroll/
For now, here's the modified block.
$(document).ajaxError(function(e,xhr,opt){
if (!opts.isDone) {
debug('Page not found. Self-destructing...');
// die if we're out of pages.
if (xhr.status == 404){
showDoneMsg();
opts.isDone = true;
opts.currPage = 0; // if you need to go back to this instance
$(opts.localMode ? this : window).unbind('scroll.infscr', infscrSetup);
$(document).unbind('retrieve.infscr.'+opts.infid,kickOffAjax);
}
}
});
from infinite-scroll.
with http://pastebin.com you can pst the original.. then "submit a correction"
and after that.
the resulting page will have a Difference link.
nice work btw. :)
from infinite-scroll.
http://pastebin.com/diff.php?i=D79Z0neS
there you go! thanks!
from infinite-scroll.
spoke too soon. after doing some more testing, i realized that each instance won't become unbound unless it reaches the end. big oops on my part.
working on a fix now.
from infinite-scroll.
forgot to mention i sorted this out. i'll send a pull request soon.
from infinite-scroll.
Solved in version 1.5.101203
from infinite-scroll.
I've been away for a while! Looking good Luke, I've added the latest commit which builds on your modification, for some reason the multi-instancing wasn't working correctly with the triggering which I've resolved. I've also added automatic generating of the instance ID when not using manual triggering.
from infinite-scroll.
Is this change implemented in the latest version of Wordpress plugin? Because when I try multiple instance, it totally crashes. Is there an extra work for defining the the multiple containers and selectors in case of multiple scrollers on the same page?
from infinite-scroll.
Related Issues (20)
- Learning html
- How can I parse the next/prev links of loaded pages? HOT 1
- standby function with sticky footer HOT 1
- infinite-scroll with websockets
- tile HOT 1
- Items shown and total items under view more button HOT 3
- Fackbook hack
- Infinite scroll + JSON
- Cloudflare mirage data-cfsrc lazy load conflict
- my tumblr theme's images not loading after page 1 (Safari only) - Infinite scroll & load more issue HOT 3
- Feature - Combination with Pagination - Load and Scroll to specific Page
- Page Link Issue
- Card Columns Not Working
- Web App For Iqama status
- Infinite-scroll and Joomla
- View Transitions
- Infinite Scroll + Masonry works only sometimes, sometimes it bugs HOT 1
- prefill loads data endlessly when container has display:none HOT 2
- Deprecating the unload event HOT 2
- Rating of a topic and infinite scroll HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infinite-scroll.