Jquery,获取div重叠的mousemove事件
请帮我。
我需要能够在带有滚动条的 div 中的图像上绘制一个矩形。
使用 IE 9 或 firefox 当鼠标点击矩形区域时 停止向图像发送 mousemove 事件。
即使 div 位于图像上方,我怎样才能使 mousemove 事件起作用?
$("#AnImage")
.mousedown(function(event)
{
//Set the start point and create the new div as a marker. Start the creating process.
})
.mousemove(function(event)
{
//Moves according to the initial point, set the with and height of the marker
})
.mouseup(function(event){
//Stop the creating process. A new Rectangle is over the image.
});
谢谢。
please help me.
I need to be able to draw a rectangle over images that are in a div with scroller.
With IE 9 or firefox when the mouse hit the rectangle area
stop sending the mousemove event to the image.
How can i make the mousemove event work, even if a div is over the image?
$("#AnImage")
.mousedown(function(event)
{
//Set the start point and create the new div as a marker. Start the creating process.
})
.mousemove(function(event)
{
//Moves according to the initial point, set the with and height of the marker
})
.mouseup(function(event){
//Stop the creating process. A new Rectangle is over the image.
});
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
pointer-events
CSS 属性 - 如果内没有要在图像上绘制的项目。
有关该属性的更多信息:此处、此处,以及此处< /a>.
You could use the
pointer-events
CSS property - if you have no items inside the<div>
that you want to draw over the image.More info on the property: here, here, and here.