ui slider 1.8.17
jQuery 1.7
I want to set a variable for the max setting of UI slider range.
var valMax = $("#youtube-player-container").tubeplayer("data").duration;
$( "#slider-range" ).slider({
range: true,
min: 0,
max: valMax, ;;HERE!!!
values: [ 75, 80 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
}
});
It needs to obtain the max value (which in this case, the duration of YouTube video) when loaded. So I tried above. But it shows the default max value, which is 100. It does not seem to work.
Is there anyway to solve this problem?
soichi