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-toggle-switch/dist/hs-toggle-switch.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 toggle switch
                    $('.js-toggle-switch').each(function () {
                      var toggleSwitch = new HSToggleSwitch($(this)).init();
                    });
                  });
                </script>
              
            

Examples

Methods

Parameters Description Default value

targetSelector

Selectors in which the text value will be changed from min to max with animation, for each element specified in the array. Essentially, count up/count down happens. undefined

isChecked

true is necessary to prepare a script for the correct processing of data, in those cases when the control element (entity), in the active (active) state. false

eventType

Event that runs the script. 'change'

min

Default value for each item. -

max

Maximum value (to which count up will be carried out), for each item. -