jQuery Minute™

…a jQuery Minute™ later and you're done!

Ask The jQuery Experts!

with 2 comments

Have a jQuery question you’d like answered or a topic explorer? Post a comment below and I may be able to help! Unfortunately, I am not able to answer or personally respond to every submission I receive but I’ll pick the best ones and share with the community!

Cheers,
- Jonathan

Written by jdsharp

October 3rd, 2009 at 1:36 am

Posted in

2 Responses to 'Ask The jQuery Experts!'

Subscribe to comments with RSS or TrackBack to 'Ask The jQuery Experts!'.

  1. can u provide me with a jquery text slider

    sidhartha

    3 Oct 09 at 10:24 am

  2. Hi,

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

    I can calculate based on one, but I am not sure how or where to put the var’s in order to pick up both slider values.

    Thanks,

    Dejan R.

    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);

    });

    Dejan R.

    15 Oct 09 at 8:31 am

Leave a Reply