nathansearles / slidesjs

SlidesJS is obsolete and no longer maintained.
https://nathansearles.github.io/slidesjs/
1.71k stars 357 forks source link

Multiple Slides, hiding 'next' / 'prev' labels + possible fix #489

Open benwill opened 11 years ago

benwill commented 11 years ago

I had two 'sliders' on a page

One had multiple pages, 1 had one page.

The second one was 'hiding' the previous/next links on the slider when it was setup.

Due to this line:

            // Hide the next/previous buttons
            $('.' + option.next + ', .' + option.prev).fadeOut(0);

My fix:

            // Hide the next/previous buttons
            $(this).parent().find('.' + option.next + ', .' + option.prev).fadeOut(0);

(Only hide the prev/next buttons within the current scope)

azicchetti commented 11 years ago

I had the same issue and this fix works, thanks

bobware commented 11 years ago

Alternatively, set the context of the jQuery selection to elem.

// slides.jquery.js:49
$( '.' + option.next + ', .' + option.prev, elem ).fadeOut(0);

Or, if yr crazy, edit the minified version!

// slides.min.jquery.js:20, column 2826 or so...
// c is the symbol assigned to elem in the minified version
a("."+b.next+", ."+b.prev, c).fadeOut(0)
richgcook commented 11 years ago

This worked perfectly — thank you so much.