How to handle "state" using Infinitescroll
I am using infinitescroll (https://github.com/paulirish/infinite-scroll)
and works without problems, awesome. But when I try to do some triggers
with state options I've got an error.
My code is something like this:
$('#wrap-entries).infinitescroll({
navSelector : '#nav-entries',
nextSelector : '#nav-entries a:first-child',
itemSelector : 'div.list-items',
debug : true,
animate : false,
loading: {
finishedMsg: 'Finito.',
img: 'image.jpg',
msgText: 'Loading',
speed:0,
start : function(){
$('#infscr-loading').hide();
console.log( this.opts.state );
}
},
});
when I try to load next content I've got this error:
Uncaught TypeError: Cannot call method 'state' of undefined
I know it should be something related with this:
state: {
isDuringAjax: false,
isInvalidPage: false,
isDestroyed: false,
isDone: false, // For when it goes all the way through the archive.
isPaused: false,
currPage: 1
}
What's the right way to handle state?
Thanks!
No comments:
Post a Comment