HI,

I am new to jquery and I am trying to calculate a value based on two
sliders.

Can somebody help me or point me into the right direction.

Thanks,

DekiR



This is the code that I am using:


        var value1;
        var value2;

        $(function() {
                $("#slider").slider({
                        value:0,
                        min: -100,
                        max: 100,
                        step: 1,
                        slide: function(event, ui) {

                                $("#amount_t").val(ui.value);

                                var sl1 = parseFloat(ui.value / 100) * 
parseFloat($("#rate").attr
("value"));

                                $("#amount1_t").val(sl1);

                                value1 = sl1;

                        }

                });


                $("#slider1").slider({
                        value:0,
                        min: -100,
                        max: 100,
                        step: 1,
                        slide: function(event, ui) {

                                $("#amount_b").val(ui.value);

                                var sl2 = parseFloat(ui.value / 100) * 
parseFloat($("#rate").attr
("value"));

                                $("#amount1_b").val(sl2);

                                value2 = sl2;

                        }

                });


                var calc = parseFloat(value1) + parseFloat(value2);

                $("#total").val(calc);

        });

Reply via email to