How to prevent text select outside HTML5 canvas on double-click?

后端 未结 3 1235
一向
一向 2021-02-14 19:16

(In every browser I\'ve tried) double-clicking on an HTML5 canvas selects any text immediately following the canvas element. I\'d prefer to keep the clicks confined to the canv

3条回答
  •  名媛妹妹
    2021-02-14 19:50

    Try putting your canvas object in a div after all the other HTML. I had this problem, all I had to do was put my floating CSS divs before (above) the canvas tag in the code (which was contained in a div).

    Just thought i'd write this just in case it helps anyone else out.

提交回复
热议问题