Reputation: 141
I am using several jQuery sliders as user inputs.
Each slider (1) is created by (2) and they work perfectly.
div class="slider" id="a_unique_identifier_for_this_slider"> /div>
$(document).ready(function() { $(".slider").slider();});
The issue I am having is that I would like for each unique slider to have a unique handle (image, shape or etc). This could be stylized in the jquery-ui.css, but it alters all my slider handles.
Is there any way that I can define several "handle styles" and then attribute them to the sliders I want?
Thanks, Clinton
Upvotes: 1
Views: 938
Reputation: 847
Just add some CSS specific to your slider div
#a_unique_identifier_for_this_slider span.ui-slider-handle { background: red; }
Upvotes: 0
Reputation: 1387
Put this in your $(document).ready(function() {})
code block:
$(".slider").slider();
$('#a_unique_identifier_for_this_slider .ui-slider-handle').eq(0).addClass("ui-slider-handle-some-unique-class");
This adds a css class for one of the sliders. You can do this for every slider. The css is up to you.
Upvotes: 1
Reputation: 17667
You would have to remove the class that applies the handle styles and add your own custom class.
var sliders = $(".slider");
sliders.slider();
sliders[0].removeClass("classNameSpecifyingTheHangle").addClass("YourNewClassName");
untested.. but this should be the general idea.
Upvotes: 0