jquery - Change calculation on switch -
so i'm trying make grafic work, i'm kind of new in whole thing have few things can't work.
the idea simple. when drag on first input[range] calculation made. answer it's after "round slider". when switch "no" formula changing, calculation it's made values both "r&d spend" , "business losses".
so...if select value=5m @ "r&d spend" calculation is: 750,000. if select value=5m @ "r&d spend", select "no" , select value=5m @ "business losses" calculation is: 2,250,000.
but in stage, if switch switch button 'yes' second input[range] dissapears(which good), calculation it's still second one, not first one, value first input.
you can see fiddle here: https://jsfiddle.net/1x60sp0a/4/
$('#js--checkbox').change(function(e) { if ($('#js--checkbox').is(':checked')) { $('#slider2').slidedown(); } else { $('#slider2').slideup(); } });
i hope i've explained well. thank much!
i've added trigger thah runs when select 'yes' @ checkbox
$('#js--checkbox').change(function(e) { if ($('#js--checkbox').is(':checked')) { $('#slider2').slidedown(); } else { $('#slider2').slideup(); $('#flying2').val('0').trigger('change'); $('#slider2out').text(0); } });
Comments
Post a Comment