jcobb / basic-jquery-slider

Simple to use, simple to theme, simple to customise.
basic-slider.com
542 stars 308 forks source link

Multiple sliders on a page #32

Closed t-lex closed 12 years ago

t-lex commented 12 years ago

Hi there,

I'm trying to put several sliders on a page. Text div on the left and image slider on the right. I changed the name of the second slider to banner2, but my divs are still looking misaligned, as are the markers, so I feel like I'm missing some kind of a differentiation, other than the name of the banner. Any suggestions?

jcobb commented 12 years ago

Hi there,

Do you have a link that I can take a look at?

JCB-K commented 12 years ago

Are you sure you have downloaded the newest version? I had the same issue, but found a fix and send a pull request.

t-lex commented 12 years ago

I think I downloaded the newest version. I got the two sliders working but had to differentiate them in the css to keep the markers looking the same, even though it seem like if i keep their ids the same they would look identical. I gotta adjust the content, but i'll put a link up in a couple of days if you don't mind taking a look john.

a-ntoine commented 12 years ago

I think Basic Jquery Slider inner functions should be wrapped up into:

return this.each(function() {  });

And line 53 should be changed into:

$slider = $container.find('ul'),

This would allow to call the plugin on multiple sliders with the same class like this:

$(document).ready(function(){
    $('.slider').bjqs({
        ....
    });
});

<div class="slider">
    <ul>
        <li><!-- Any content you like --></li>
        <li><!-- Can go inside these slides--></li>
    </ul>
</div>

The current unique ID call would still work.

jcobb commented 12 years ago

Thanks a-ntoine, I'll look in to that

artemean commented 10 years ago

Doesn't seem like fixed. I added two containers for bjqs on one page and both fall apart. One is empty and the other one grabs slides from both containers. Am I doing something wrong?

artemean commented 10 years ago

Ok, I got it. You need to initialize each slider with a separate bjqs() call. Weird but works