{"id":13724599,"url":"https://github.com/vsn4ik/input-spinner","last_synced_at":"2026-03-10T02:04:34.759Z","repository":{"id":11636026,"uuid":"14138641","full_name":"vsn4ik/input-spinner","owner":"vsn4ik","description":"A Number-Spinner, Support keyboard operations and continuous changing.","archived":false,"fork":false,"pushed_at":"2025-04-14T05:51:31.000Z","size":1123,"stargazers_count":310,"open_issues_count":12,"forks_count":83,"subscribers_count":31,"default_branch":"master","last_synced_at":"2026-01-14T21:30:47.105Z","etag":null,"topics":["continuous","delay","javascript","number-spinner","number-steps","spinner"],"latest_commit_sha":null,"homepage":"https://vsn4ik.github.io/input-spinner/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsn4ik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-05T10:34:22.000Z","updated_at":"2025-10-01T12:41:01.000Z","dependencies_parsed_at":"2022-08-30T12:10:22.203Z","dependency_job_id":"f1bd08c1-91ec-4d2d-9acb-899466caba47","html_url":"https://github.com/vsn4ik/input-spinner","commit_stats":null,"previous_names":["vsn4ik/jquery.spinner","vsn4ik/jquery-spinner","xixilive/jquery-spinner"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/vsn4ik/input-spinner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsn4ik%2Finput-spinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsn4ik%2Finput-spinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsn4ik%2Finput-spinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsn4ik%2Finput-spinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsn4ik","download_url":"https://codeload.github.com/vsn4ik/input-spinner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsn4ik%2Finput-spinner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30322638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous","delay","javascript","number-spinner","number-steps","spinner"],"created_at":"2024-08-03T01:02:00.123Z","updated_at":"2026-03-10T02:04:30.310Z","avatar_url":"https://github.com/vsn4ik.png","language":"JavaScript","readme":"# [Input Spinner](https://vsn4ik.github.io/input-spinner/)\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Build Status](https://github.com/vsn4ik/input-spinner/actions/workflows/test.yml/badge.svg)](https://github.com/vsn4ik/input-spinner/actions/workflows/test.yml)\n\n\nA Number-Spinner, Support keyboard operations and continuous changing.\n\n## Basic usage, it's very simple\n```html\n\u003c!-- // ref javascript file --\u003e\n\u003cscript src=\"dist/input-spinner.js\"\u003e\u003c/script\u003e\n\n\u003c!-- // spinner plugin DOM --\u003e\n\u003cdiv data-trigger=\"spinner\"\u003e\n  \u003cbutton type=\"button\" data-spin=\"up\"\u003e+\u003c/button\u003e\n  \u003cinput type=\"text\" value=\"1\" data-ruler=\"quantity\"\u003e\n  \u003cbutton type=\"button\" data-spin=\"down\"\u003e-\u003c/button\u003e\n\u003c/div\u003e\n```\n\n## Getting Started\nDownload the [production version][production] or the [development version][development].\n\nIn your web page:\n\n```html\n\u003cscript src=\"jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/input-spinner.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  $('#spinner')\n    .spinner('delay', 200) // delay in ms\n    .spinner('changed', function(e, newVal, oldVal) {\n      // trigger lazed, depend on delay option.\n    })\n    .spinner('changing', function(e, newVal, oldVal) {\n      // trigger immediately\n    });\n\u003c/script\u003e\n\n\u003cdiv data-trigger=\"spinner\" id=\"spinner\"\u003e\n  \u003cbutton type=\"button\" data-spin=\"up\"\u003e+\u003c/button\u003e\n  \u003cinput type=\"text\" value=\"1\" data-ruler=\"quantity\"\u003e\n  \u003cbutton type=\"button\" data-spin=\"down\"\u003e-\u003c/button\u003e\n\u003c/div\u003e\n```\n\n## Documentation\n### Spinner options\n\n#### delay\n\u003e delay to fire changed event in millisecond, default is 500.\n\n#### changed\n\u003e changed event handler, the changed event is a lazy-mode event, default is null.\n\n#### changing\n\u003e changing event handler, the changing event will be fired immediately, default is null.\n\n### Spinning Options(setup via data-api)\n#### min\n\u003e the minimum value, default is null.\n\n#### max\n\u003e the maximum value, default is null.\n\n#### step\n\u003e the changing-value of per-step, if passed as a function, the function will be called within the spinner object scope.\n\n#### precision\n\u003e the precision of value\n\n### Built-in rules\n```javascript\n  currency: { min: 0.00, max: null, step: 0.01, precision: 2 },\n  quantity: { min: 1, max: 999, step: 1, precision:0 },\n  percent:  { min: 1, max: 100, step: 1, precision:0 },\n  month:    { min: 1, max: 12, step: 1, precision:0 },\n  day:      { min: 1, max: 31, step: 1, precision:0 },\n  hour:     { min: 0, max: 23, step: 1, precision:0 },\n  minute:   { min: 1, max: 59, step: 1, precision:0 },\n  second:   { min: 1, max: 59, step: 1, precision:0 }\n```\nUsage:\n```html\n\u003cinput type=\"text\" value=\"1\" data-rule=\"quantity\"\u003e\n```\n\n## Examples\n\n### Work with Bootstrap and Font Awesome\n\n```html\n\u003clink href=\"dist/input-spinner.css\" rel=\"stylesheet\"\u003e\n\n\u003cdiv class=\"input-group spinner\" data-trigger=\"spinner\"\u003e\n  \u003cinput type=\"text\" class=\"form-control text-center\" value=\"1\" data-rule=\"quantity\"\u003e\n  \u003cspan class=\"input-group-addon\"\u003e\n    \u003ca href=\"javascript:;\" class=\"spin-up\" data-spin=\"up\"\u003e\u003ci class=\"fa fa-caret-up\"\u003e\u003c/i\u003e\u003c/a\u003e\n    \u003ca href=\"javascript:;\" class=\"spin-down\" data-spin=\"down\"\u003e\u003ci class=\"fa fa-caret-down\"\u003e\u003c/i\u003e\u003c/a\u003e\n  \u003c/span\u003e\n\u003c/div\u003e\n```\n\n### Customize\n\n#### specify a field\n\n```html\n\u003cdiv data-trigger=\"spinner\"\u003e\n  \u003cinput type=\"text\" value=\"0\" title=\"this field isn't a spinning.\"\u003e\n  \u003cinput type=\"text\" value=\"1\" data-spin=\"spinner\" data-rule=\"quantity\" data-max=\"10\"\u003e\n\u003c/div\u003e\n```\n\n#### Use hidden field\n\n```html\n\u003cdiv data-trigger=\"spinner\" id=\"spinner\"\u003e\n  \u003cspan id=\"spinner-value\"\u003e\u003c/span\u003e\n  \u003cinput type=\"hidden\" value=\"1\" data-spin=\"spinner\" data-rule=\"quantity\" data-max=\"10\"\u003e\n  \u003ca href=\"javascript:;\" data-spin=\"down\"\u003e-\u003c/a\u003e\n  \u003ca href=\"javascript:;\" data-spin=\"up\"\u003e+\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cscript\u003e\n  $('#spinner').spinner('changing', function(e, newVal, oldVal) {\n    $('#spinner-value').html(newVal);\n  });\n\u003c/script\u003e\n```\n\n#### pass step options as a function\n```javascript\n// To skip 0\n$('#spinner').spinner({\n  step: function(dir) {\n    // 'this' references to the spinner object\n    if ((this.oldValue === 1 \u0026\u0026 dir === 'down') || (this.oldValue === -1 \u0026\u0026 dir === 'up')) {\n      return 2;\n    }\n    return 1;\n  }\n});\n\n// or use API syntax\n$('#spinner').spinner('step', function(dir) {\n  // your logic here\n});\n```\n\n\n## Copyright and license\n\nCopyright Vasilii A., 2015\u0026ndash;2018\nCopyright xixilive, 2013\u0026ndash;2015\n\nLicensed under [the MIT License][license].\n\n[license]: https://github.com/vsn4ik/input-spinner/blob/master/LICENSE\n[development]: https://raw.githubusercontent.com/vsn4ik/input-spinner/master/dist/input-spinner.min.js\n[production]: https://raw.githubusercontent.com/vsn4ik/input-spinner/master/dist/input-spinner.js\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsn4ik%2Finput-spinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsn4ik%2Finput-spinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsn4ik%2Finput-spinner/lists"}