Last active
February 3, 2018 14:33
-
-
Save dpmango/aee41381729c602a0bd8da54f3db29a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.ui-number span').on('click', function(e){ | |
var element = $(this).parent().find('input'); | |
var currentValue = parseInt($(this).parent().find('input').val()) || 0; | |
if( $(this).data('action') == 'minus' ){ | |
if(currentValue <= 1){ | |
return false; | |
}else{ | |
element.val( currentValue - 1 ); | |
} | |
} else if( $(this).data('action') == 'plus' ){ | |
if(currentValue >= 99){ | |
return false; | |
} else{ | |
element.val( currentValue + 1 ); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment