Incrementing value continuously on mouse hold

前端 未结 4 1766
终归单人心
终归单人心 2020-12-20 14:49

I have an HTML5 \'range\' control to which I want to add a plus (+) and minus (-) buttons on either sides.

The fiddle works fine, except that the value increase (or

4条回答
  •  甜味超标
    2020-12-20 15:46

    This answer should help.

    The click event includes mouseup and mousedown. You'll want to handle mousedown alone at first, and continuously check to see if the mouse is still down. You can stop checking on document mouseup.

提交回复
热议问题