JSPM

  • Created
  • Published
  • Downloads 2646
  • Score
    100M100P100Q112337F
  • License MIT

Bootstrap/jQuery plugin to create input spinner elements with Bootstrap 4.

Package Exports

  • bootstrap-input-spinner

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bootstrap-input-spinner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

bootstrap-input-spinner

A Bootstrap/jQuery plugin to create input spinner elements with Bootstrap 4.

Example

Demo Page

Usage

<input type="number" value="50" min="0" max="100" step="10"/>
<script>
    $("input[type='number']").InputSpinner();
</script>

Syntax

HTML

Uses the following tag-attributes:

  • min
  • max
  • step
  • data-decimals
<input type="number" value="4.5" data-decimals="2" min="0" max="9" step="0.1"/>

JavaScript

$(element).InputSpinner(config);

default config is:

const config = {
    decrementHtml: "<strong>-</strong>", // button text
    incrementHtml: "<strong>+</strong>", // button text
    buttonClass: "btn-outline-secondary",
    buttonWidth: "2.5em",
    textAlign: "center",
    autoDelay: 500, // ms holding before auto value change
    autoInterval: 100, // speed of auto value change
    boostThreshold: 15, // boost after these steps
    boostMultiplier: 10
};