default emptry string val to 0 on refresh Fixes #3029

This commit is contained in:
John Bender 2011-12-05 15:38:15 -08:00
parent 5f6ce0d651
commit cbaa42d63c

View file

@ -269,7 +269,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
percent = Math.round( ( ( data.pageX - this.slider.offset().left ) / this.slider.width() ) * 100 );
} else {
if ( val == null ) {
val = cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
val = cType === "input" ? parseFloat( control.val() || 0 ) : control[0].selectedIndex;
}
percent = ( parseFloat( val ) - min ) / ( max - min ) * 100;
}