grosmethos a écrit a écrit :
hello
voila je vourais afficher les coordonnes de la sourie en javascript voici mon code :
<script language="JavaScript">
document.onMouseDown=affichage;
function affichage()
{e=window.event;
alert("abscisse"+e.x);}
apparement il ne detecte pas l'evenement dans mon document???
des idées
|
un petit exemple de script:
<SCRIPT>container1.captureEvents(Event.MOUSEUP|Eve
nt.MOUSEDOWN);container1.onmousedown=DRAG_begindra
g;container1.onmouseup=DRAG_enddrag;var DRAG_lastX, DRAG_lastY, DRAG_dragging;function DRAG_begindrag(e) { if (e.which == 1) { window.captureEvents(Event.MOUSEMOVE); window.onmousemove=DRAG_drag; DRAG_lastX=e.pageX; DRAG_lastY=e.pageY; DRAG_dragging=true; return false; } else { /*Do any right mouse button processing here*/ return true; }}function DRAG_enddrag(e) { if (e.which == 1) { window.releaseEvents(Event.MOUSEMOVE); window.onmousemove=null DRAG_dragging=false; return false; } else { /*Do any right mouse button processing here*/ return true; }}function DRAG_drag(e) { if (DRAG_dragging) { /*This function called only if MOUSEMOVEs are captured*/ moveBy(e.pageX-DRAG_lastX, e.pageY-DRAG_lastY); DRAG_lastX = e.pageX; DRAG_lastY = e.pageY; return false; } else { return true; }}</SCRIPT>
ça te va?