Browse files

checking slider for empty val when refreshing

  • Loading branch information...
1 parent b210688 commit 54761821c7e043c7daec0b4c9035f0647a2eedc9 @MauriceG committed Nov 12, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 js/jquery.mobile.forms.slider.js
View
3 js/jquery.mobile.forms.slider.js
@@ -270,6 +270,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
if ( val == null ) {
val = cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
}
+ if ( isNaN( val ) ) {
+ val = 0;
+ }
percent = ( parseFloat( val ) - min ) / ( max - min ) * 100;
}

1 comment on commit 5476182

@MauriceG
Owner

because parseFloat( null ) returns NaN

Please sign in to comment.