I'm trying to use a JQueryUI slider to control the opacity of an element with the id "main-lights", but this script causes an error.
$("#slider-lamps").slider({
orientation: "vertical",
range: "min",
value: 50,
min: 0,
max: 100
slide: function( event, ui ) {
$( "#main-lights" ).css( "opacity", ui.values[ 0 ]);
}
});
This version works fine:
$("#slider-lamps").slider({
orientation: "vertical",
range: "min",
value: 50,
min: 0,
max: 100
});
Can I not use a variable as the second jquery .css parameter?
How can I write this properly?