Adding Step to Custom jQuery Spinner
Can you please take a look at This Demo and let me know How I can add step to code to increment the value every time by adding 10 to the existing until getting to 100? and decrements the value until zero?
As I said i need to have a step on 10 number.
- <div class="btn-group input-group">
- <button type="button" class="btn btn-default minus">-</button>
- <button type="button" class="btn btn-default opacity">% 0 </button>
- <button type="button" class="btn btn-default plus">+</button>
- </div>
- $(document).ready(function () {
- var i=1;
- $(".plus").on("click", function () {
- if(i<11) $(".opacity").html("% " +i++);
- });
- $(".minus").on("click", function () {
- if(i>0) $(".opacity").html("% " +i--);
- });
- });
Thanks