Skylight_lady Posted August 29, 2012 Share Posted August 29, 2012 Hi Guys, Is there any cash/price slide bar around like wonga dot com. Their code is a bit complicated so i want something very similar with a few rows of sliders. Link to comment https://forums.phpfreaks.com/topic/267726-any-cash-slide-bar/ Share on other sites More sharing options...
Mahngiel Posted August 29, 2012 Share Posted August 29, 2012 how is sliding by 'cash' any different than sliding by 'real' numbers? http://jqueryui.com/demos/slider/#range Link to comment https://forums.phpfreaks.com/topic/267726-any-cash-slide-bar/#findComment-1373467 Share on other sites More sharing options...
Skylight_lady Posted September 11, 2012 Author Share Posted September 11, 2012 Hi, Thanks for that. Is there a using that by calculating 2 figures with two sliders together? I have the following code eg: $( "#slider-range-max" ).slider({ range: "max", min: 0, max: 90000, value: 45000, slide: function( event, ui ) { $( "#amount" ).val( ui.value ); var aaa = $("#amount").val(); var bbb = $("#amountb").val(); var ccc = $("#amountc").val(); var ddd = $("#amountd").val(); var eee = $("#amounte").val(); var fff = $("#amountf").val(); $("#total").val(+aaa + +bbb + +ccc + +ddd + +eee + +fff); } }); $( "#slider-range-max-dif" ).slider({ range: "max", min: 0, max: 30, value: 15, slide: function( event, ui ) { $( "#difference" ).val( ui.value ); var adif = $("#difference").val(); var bdif = $("#differenceb").val(); var cdif = $("#differencec").val(); var ddif = $("#differenced").val(); var edif = $("#differencee").val(); var fdif = $("#differencef").val(); $("#total_dif").val(+adif + +bdif + +cdif + +ddif + +edif + +fdif); } }); However, i can't seem to get something like this calculation to work: $("#result").val(+aaa * (+adif / 100)); and $( "#result" ).val( $( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) ) * ( $( "#difference" ).val( $( "#slider-range-max-dif" ).slider( "value" ) ) / 100 ) ); With either of the codes above i'm trying to get the result from one row by dividing the adif by 100 and multiplying it by aaa. The result i seem to be getting is NaN. Whats the correct way to do this. I'm no javascript/jquery expert. Link to comment https://forums.phpfreaks.com/topic/267726-any-cash-slide-bar/#findComment-1377042 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.