Jquery UI slider handle on last saved value

Liska

New Member
How can I set the handle to start on the last saved value? For some reason it's always in the last position. I'm setting my start position and max value using values from the database but here is a working example:http://jsfiddle.net/hcKwQ/ Slide should start at 5, not 10 the max value.. Please help I don't know what I'm doing wrong.Script:\[code\]$(function() { $( "#slider" ).slider({ range: "min", value: $("input[name='shirts']").val(), min: 1, max: $("input[name='max_shirts']").val(), step: 1, slide: function( event, ui ) { $( "#amount" ).text( ui.value ); }, stop: function( event, ui ) { $( "#shirts" ).val( ui.value ); } });});\[/code\]HTML: \[code\]<div id="slider"></div><div class="amount" id="amount"></div><input type="hidden" name="shirts" value="http://stackoverflow.com/questions/11024567/<?php echo $shirts; ?>" id="shirts"><input type="hidden" name="max_shirts" value="http://stackoverflow.com/questions/11024567/<?php echo $max_shirts; ?>" id="max_shirts">\[/code\]
 
Top