2011-11-28 5 views
0

도와주세요.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. 
}); 

감사합니다.

+0

'mosemove'는 오타입니다. 실제 코드에서'mousemove'입니까? –

+0

jsfiddle을 만들 수 있습니까? – mrtsherman

+0

예가 MouseMove .. Jquery 이벤트입니다. 죄송합니다 – Fraga

답변

1

<div> 안에 이미지를 그릴 항목이없는 경우 pointer-events CSS 속성을 사용할 수 있습니다. 재산에

#AnImage { 
    pointer-events: none; 
} 

더 많은 정보 : here, herehere.

+0

와우 !! .. 나는이 CSS 속성을 알지 못했습니다! 그것의 놀라운 !! ... 내 문제를 해결 !! !!하지만 나는 그들이 뒤에있는 경우에도 왜 firefox가 mousemove 이벤트를 보내는 것을 멈추는 지보고 싶다. – Fraga

관련 문제