Jump to content

Any cash slide bar?


Skylight_lady

Recommended Posts

  • 2 weeks later...

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.