Skip to content

Commit e09374b

Browse files
jrownyjohnbender
authored andcommitted
add slider step support from jQuery UI
1 parent 7d20423 commit e09374b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/jquery.mobile.forms.slider.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
254254
var control = this.element, percent,
255255
cType = control[0].nodeName.toLowerCase(),
256256
min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
257-
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1;
258-
257+
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1,
258+
step = (cType === "input" && parseFloat(control.attr("step"))>0) ? parseFloat(control.attr("step")) : 1;
259+
259260
if ( typeof val === "object" ) {
260261
var data = val,
261262
// a slight tolerance helped get to the ends of the slider

0 commit comments

Comments
 (0)