View Single Post
Old 01-31-2013, 12:23 PM   PM User | #1
jonnystudent
New to the CF scene

 
Join Date: Jan 2013
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
jonnystudent is an unknown quantity at this point
Animate jquery ui slider handle to specific value on pageload

I'm having problems getting a slider to animate to a certain value. The value is within the handle. I want the handle to automatically move on pageload to a specific value. The value has to increment up to the value though.

I've created a script in where I'm animating the handle but I can't get the values to increment accordingly. Here is my current script.

Slider1:

Code:
$("#slider1").slider({
    max:350,
    min:100,
    step:10,
    value:100,
    animate: 'true',
	animate: 6000,
    slide: function(event, ui) {  
        $("#amount").val(ui.value);
        $(this).find('.ui-slider-handle').html('<div class="sliderControl-label v-labelCurrent">£'+ui.value+'</div>');
        
                update();
       
    } ,
    change :function(event, ui) {  
        $("#amount").val(ui.value);
        $(this).find('.ui-slider-handle').html('<div class="sliderControl-label v-labelCurrent">£'+ui.value+'</div>');
        
                update();       
    } 
});
$("#slider1").slider("value", 200);
update();
On page load, the value should start at 100 and then automatically increment in 10's up to 200. Although, 200 just appears.

Any help would be greatly appreciated. Cheers.
jonnystudent is offline   Reply With Quote