jscroll icon indicating copy to clipboard operation
jscroll copied to clipboard

Can't have 2 jscroll instances on the same page

Open Marvin256 opened this issue 9 years ago • 6 comments

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?

Marvin256 avatar Sep 23 '15 09:09 Marvin256

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)

Marvin256 avatar Sep 24 '15 09:09 Marvin256

+1 I have same problem

hoannv avatar Oct 21 '15 10:10 hoannv

@pklauzinski can you instruct how make jscroll to work with multiple instances at same page ?

hoannv avatar Oct 21 '15 14:10 hoannv

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.

pklauzinski avatar Nov 05 '15 20:11 pklauzinski

Just made a pull request that contains an extension to support multiple jscrolls.

mrIllo avatar Dec 20 '16 21:12 mrIllo

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.

Enalmada avatar May 24 '18 06:05 Enalmada