How to use

Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.

              
                <script src="../assets/vendor/hs-quantity-counter/dist/hs-quantity-counter.min.js"></script>
              
            

Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.

              
                <script>
                  $(document).on('ready', function () {
                    // initialization of quantity counter
                    $('.js-quantity-counter').each(function () {
                      var quantityCounter = new HSQuantityCounter($(this)).init();
                    });
                  });
                </script>
              
            

Basic examples

Methods

Parameters Description Default value

classMap.plus

Selector, inside the initialized element, which is responsible for adding a unit to the current value '.js-plus'

classMap.minus

Selector, inside the initialized element, which is responsible for subtracting the unit from the current value '.js-minus'

classMap.result

Selector, inside the initialized element, which is responsible for displaying the current value '.js-result'