0

请帮我。

我需要能够在带有滚动条的 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.
});

谢谢。

4

1 回答 1

1

您可以使用pointer-eventsCSS 属性 - 如果您没有<div>要在图像上绘制的项目。

#AnImage {
  pointer-events: none;
}

有关该物业的更多信息:这里这里这里

于 2011-11-28T07:52:25.620 回答