Spinner

Extend from $.fn.validatebox.defaults. Override defaults with $.fn.spinner.defaults.

Dependencies

Usage

  1. <input id="ss" value="2">  
  1. $('#ss').spinner({  
  2.     required:true,  
  3.     increment:10  
  4. });  

Properties

The properties extend from validatebox, below is the added properties for spinner.

Name Type Description Default
width number The width of this component. auto
value string The initialize value.
min string The minimum allowed value. null
max string The maximum allowed value. null
increment number The increment value when click spinner button. 1
editable boolean Defines if user can type value directly into the field. true
disabled boolean Defines if to disable the field. false
spin function(down) A function called when user click the spinner button.

Events

Name Parameters Description
onSpinUp none Fires when user click the up spinner button.
onSpinDown none Fires when user click the down spinner button.

Methods

The methods extend from validatebox, below is the added methods for spinner.

Name Parameter Description
options none Return the options object.
destroy none Destroy the spinner component.
resize width Reset the component width.
enable none Enable the component.
disable none Disable the component.
getValue none Get the component value.
setValue value Set the component value.
clear none Clear the component value.