I need to understand the format in which I should pass on the arguments to a specific function. I am planning to use spinner library and you can check it's demo here. I need to specify the minimum and the default values to the function spinner. The function in default mode is used as:
$('.spinnerExample').spinner()
However I need to pass on custom values for default and minimum values. The definition of the function is as follows:
(function ($) {
$.fn.spinner = function (opts) {
return this.each(function () {
var defaults = {value:0, min:0}
var options = $.extend(defaults, opts)
var keyCodes = {up:38, down:40}
var container = $('<div></div>')
container.addClass('spinner')....
The link to the js file is here.
I tried $('.spinnerExample').spinner(5,2) but this does not work. I am sure the solution is simple but I dont know javascript well so I am not able to crack it.
Thanks