I've got 2 Jquery sliders and when I get them working together they break. The first slider measures weight, and the second exercise. I'm trying to code a final value, the 'outcome' the displays the outcome of both.
When the 1st weight slider increases, so does the outcome value. When the 2nd exercise slider increases, the final outcome goes down. I'm just using simple number values until i get my head around it, how do I get them working together?
$(function() {
$( "#slider_1" ).slider({
value:100,
min: 0,
max: 500,
step: 50,
slide: function( event, ui ) {
$( "#amount" ).val( "+" + ui.value );
}
});
$( "#amount" ).val( "+" + $( "#slider_1" ).slider( "value" ) );
});
$(function() {
$( "#slider_2" ).slider({
value:100,
min: 0,
max: 9,
step: 5,
slide: function( event, ui ) {
$( "#amount2" ).val( "+" + ui.value );
}
});
$( "#amount2" ).val( "$" + $( "#slider_2" ).slider( "value" ) );
});