jscroll
jscroll copied to clipboard
Can't have 2 jscroll instances on the same page
Hello
I'm trying to make jscroll to work with 2 instances in the same time: I want to load next posts in the middle of the page and next instagram posts at the bottom of the page.
I can make the first one to work but not the second one and vice versa.
Here's how I do it:
$('#lazy-posts').jscroll(
{
debug: true,
loadingHtml:'',
padding: 0,
nextSelector: 'a.jscroll-next-posts:last',
contentSelector: ''
}
);
// lazy loading instagram
$('#lazy-instagram').jscroll(
{
loadingHtml:'',
padding: 0,
nextSelector: 'a.jscroll-next-instagram:last',
contentSelector: ''
}
);
Is it possible to do this?
Gave up with this one and coded my own lazy loader :-)
I don't know why I couldn't make this to work like the exemple on jscroll.com (3 instances at the same time)
+1 I have same problem
@pklauzinski can you instruct how make jscroll to work with multiple instances at same page ?
It depends on how you set them up. Are you trying to put them in separate containers on a page that have a fixed height and overflow-y: auto
or overflow-y: scroll
set? This is how the examples are set up on jscroll.com. Otherwise, please provide an example of how you are attempting to place multiple instances on one page.
Just made a pull request that contains an extension to support multiple jscrolls.
If you are having trouble getting two jscroll at the same time, the pull request https://github.com/pklauzinski/jscroll/pull/119 above is probably the solution...it worked for me.