1.1.0 • Published 8 years ago
interval-input v1.1.0
intervalInput()
jQuery plugin which allow make interval from the input. Returns number of seconds calculated from the interval.
Usage
Base:
$('#selector').intervalInput();
Changed format:
$('#selector').intervalInput({
format: 'h[-]i[-]s'
});
Event listener:
$('#selector').intervalInput();
$('#selector').on('intervalinputchange', function(e, data) {
// do something on change event
});
See all examples.
API
Description of the API provided by the plugin.
Options
translations
Input tooltips texts.
Default:
{
w: 'weeks',
d: 'days',
h: 'hours',
i: 'minutes',
s: 'seconds'
}
format
Format used to generate the inputs for interval.
Available options:
w
- weeksd
- daysh
- hoursi
- minutess
- seconds
Plugin allows to pass constant between options using braces ([
, ]
).
Syntax:
d[days]h[:]s
This example generate following structure: <input>days<input>:<input>
Default:
d[days]h[:]i[:]s
Methods
setEnabled(enabled)
enabled
boolean
Set enabled or disabled plugin inputs.
refresh()
Recalcualte interval values.
Events
intervalinputchange
Event triggered on change value in the any input.