Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我制作了一个脚本,允许用户拖动图像。不幸的是,尽管大多数浏览器都将图像突出显示为蓝色。有没有办法在所有浏览器中禁用此行为?
从 mousedown/mousemove 处理程序返回 false 以防止默认浏览器操作(默认操作是在鼠标拖动时选择底层元素)。
编辑
我的意思是这样的:
document.onmousemove = function() { // Do your stuff return false; }
你可能有不同的外观功能,但最后,把return false.
return false