Change cursor over HTML5 Canvas when dragging the mouse

后端 未结 5 1324
梦毁少年i
梦毁少年i 2020-12-16 12:34

I have made a paint brush type of application using the Canvas Tag . I wanted that when the mouse is on the canvas the Cursor Changes ,



        
5条回答
  •  不知归路
    2020-12-16 13:36

    Use the :active CSS pseudo-class to change the cursor when the mouse button is down over the element:

    #draw:active { 
        cursor: url(image/pencil.cur);
    }
    

    Working example: http://jsfiddle.net/nXv63/

提交回复
热议问题