add slider step support from jQuery UI

This commit is contained in:
jrowny 2011-08-11 17:37:58 -04:00 committed by John Bender
parent 7d204230f0
commit e09374b41d

View file

@ -254,8 +254,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
var control = this.element, percent,
cType = control[0].nodeName.toLowerCase(),
min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1;
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1,
step = (cType === "input" && parseFloat(control.attr("step"))>0) ? parseFloat(control.attr("step")) : 1;
if ( typeof val === "object" ) {
var data = val,
// a slight tolerance helped get to the ends of the slider