Fraga
Fraga

Reputation: 1451

Jquery, get the mousemove event with a div overlaping

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.

Upvotes: 0

Views: 690

Answers (1)

Labu
Labu

Reputation: 2582

You could use the pointer-events CSS property - if you have no items inside the <div> that you want to draw over the image.

#AnImage {
  pointer-events: none;
}

More info on the property: here, here, and here.

Upvotes: 1

Related Questions