HTML Canvas双击突出显示问题 [英] HTML Canvas Double Click Highlight Issue

查看:191
本文介绍了HTML Canvas双击突出显示问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML画布,我已经实现了一个简单的双击功能。当页面只包含画布时,一切都可以正常工作。但是,一旦我添加了一个简单的文本输入字段,每次我双击奇怪的事情开始被突出显示(尝试随机点击此页面的某些部分,并出现类似的情况)。



有什么最好的方法来解决这个问题?我需要将画布放在某物中(我尝试将其包围在表格中,但情况更糟),或者我需要断开特定信号。



谢谢

解决方案

我在这里找到了一个简单的解决方案。



a href =https://stackoverflow.com/questions/3799686/clicking-inside-canvas-element-selects-text>单击画布内的元素选择文本


I have an HTML canvas and I have implemented a simple double click function. When the page contains only a canvas, everything works fine. However, as soon as I add, for example, a simple text input field, everytime I double click strange things start to get highlighted (try randomly clicking on certain parts of this page and a similar situation arises).

What's the best way to get around this? Do I need to enclose the canvas in something (I tried enclosing it in a table but that made the situation worse) or do I need to disconnect a specific signal.

Thanks

解决方案

I found a simple answer to this problem here

Clicking inside canvas element selects text

这篇关于HTML Canvas双击突出显示问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆