CSS-Tricks / AnythingSlider

A jQuery Slider plugin for anything.
http://css-tricks.github.io/AnythingSlider/
GNU Lesser General Public License v3.0
1.15k stars 380 forks source link

Updating a slider option doesn't seem to work when there are multiple sliders. #505

Closed shodaburp closed 11 years ago

shodaburp commented 11 years ago

Hi,

I managed to update a slider option after an event following this guide here: https://github.com/CSS-Tricks/AnythingSlider/wiki/Usage.

However, it only works when there's only 1 slider on the page: http://jsfiddle.net/shodaburp/rpE3M/1/

The update option no longer works when there's a second slider on the page: http://jsfiddle.net/shodaburp/rpE3M/

Even after separating the event controller, only the second slider option gets updated and not the first one: http://jsfiddle.net/shodaburp/rpE3M/2/

Kindly advise on how to update the option(s) for each slider accordingly. Thank you :)

Mottie commented 11 years ago

Hi @shodaburp!

My apologizes for taking so long to respond!

The enableKeyboard option only attaches handlers to the slider. To make a slider active, use the makeActive() function (updated demo):

$('#slider').data('AnythingSlider').makeActive();
Mottie commented 11 years ago

I am guessing this issue has been resolved, so I'm closing it. Please feel free to reopen this issue if you continue to have problems. For any further questions, please use the CSS-Tricks forums. Thanks!