Reputation: 61
I hava a jquery mobile slider.
<input name="slider-1" id="slider-1" data-highlight="true"min="0"
max="100" value="50" type="range">
I want to change the color of the highlight fill on the track of the slider? (By default its blue ). this is my code but its not work
$("#slider-1").effect("highlight", { color: "#ff00ff" }, 3000);
Thanks
Upvotes: 2
Views: 1581
Reputation: 6111
Use the .css
property for it and want to change background with animation use the animate
function.
$("#slider-3").css("background-color","#ff00ff");
jQuery .css Documentation
Upvotes: 0
Reputation: 2701
Add your color code in this css class and dont change class name.
.ui-btn-active {
background: linear-gradient(#5393C5, #6FACD5) repeat scroll 0 0 #5393C5;
border: 1px solid #2373A5;
color: #FFFFFF;
cursor: pointer;
font-family: Helvetica,Arial,sans-serif;
font-weight: bold;
text-decoration: none;
text-shadow: 0 1px 1px #3373A5;
}
Upvotes: 1
Reputation: 56509
You're using the wrong selector to change the default color of the slider.
div.ui-btn-active
this is right one
div.ui-btn-active{
background: #ff00ff;
}
Using jQuery,
$("div.ui-btn-active").css("background","#ff00ff");
Check this fiddle
Upvotes: 3
Reputation: 6795
I think the CSS solution is better:
#slider-3::selection
{
color:#ffffff;
background-color:#ff0000;
}
#slider-3::-moz-selection /* firefox*/
{
color:#ffffff;
background-color:#ff0000;
}
Upvotes: 1