1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
var cursorPosX = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.clientX;
var cursorPosY = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.clientY;
while (document.images[n])
{
// enregistrement de la position de l'image droppable
objPosLeft=parseInt(document.images[n].style.left);
objPosTop=parseInt(document.images[n].style.top);
// position de l'objet sur lequel il est cliqué
if ((cursorPosX > objPosLeft) &&
(cursorPosX < objPosLeft + document.images[n].width) &&
(cursorPosY > objPosTop) &&
(cursorPosY < objPosTop + document.images[n].height))
{ // Si le curseur est dans la zone d'affichage de l'image
return true;
}
else return false;
} |