<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
.
<script type="text/javascript">
function Deplace( evt )
{ var posCur={ "x":0, "y":0 };
if ( window.event )
{ posCur.x=window.event.x+document.body.scrollLeft;
posCur.y=window.event.y+document.body.scrollTop;
}
else { posCur.x=evt.pageX;
posCur.y=evt.pageY;
}
return posCur;
}
document.body.onmousemove=function(event)
{ var p=Deplace( event );
document.getElementById("iddv").innerHTML="X:"+p.x+" / Y:"+p.y;
};
</script>
</html>
function zoomer(zoomx,min) { if(document.getElementById) { zoom *= zoomx; if (zoom<min){zoom=min} document.getElementById("module").style.height=zoom+'px'; } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionfunction zoomer(zoomx,min,PosCur) { if(document.getElementById) { zoom *= zoomx; var X=(PosCur.x-5); var Y=(PosCur.y-95); if (zoom <min){zoom=min} document.getElementById("module").style.height =zoom+'px'; if ((PosCur.x>10&&PosCur.x<680)&&(PosCur.y>100&&PosCur.y<580)) { if (parseInt(document.getElementById("Box").style.height)<document.getElementById("module").height) { document.getElementById("module").style.top =((document.getElementById("module").height)/2)-Y/2+'px'; if (parseInt(document.getElementById("Box").style.width)<document.getElementById("module").width) { document.getElementById("module").style.left =((document.getElementById("module").width)/2)-X/2+'px'; } } }else { if (parseInt(document.getElementById("Box").style.height)<document.getElementById("module").height) { document.getElementById("module").style.top =(parseInt(document.getElementById("Box").style.height)-document.getElementById("module").height)/2+'px'; if (parseInt(document.getElementById("Box").style.width)<document.getElementById("module").width) { document.getElementById("module").style.left =(parseInt(document.getElementById("Box").style.width)-document.getElementById("module").width)/2+'px'; } } } } }