1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<html>
<body>
<div name="im1" id="im1" class="image" style="position:absolute;left:50;top:300;">
<img src="../../../Documents and Settings/Claire & Jérome/Bureau/image.JPG" width="260" height="195" alt="" border="0" align="">
</div>
<script type="text/javascript">
N = (document.all) ? 0 : 1;
if (N) {
ob = document.getElementById('im1');
}
document.onmousedown = MD;
function MD(e) {
document.onmousemove = MM;
document.onmouseup = MU;
if (N) {
X=e.pageX;
Y=e.pageY;
X0=ob.style.left;
Y0=ob.style.top;
X0 = X0.substr(0,X0.length-2);
Y0 = Y0.substr(0,Y0.length-2);
X0 = X0*1;
Y0 = Y0*1;
}
else {
ob = event.srcElement.parentElement.style;
X=event.offsetX;
Y=event.offsetY;
}
}
function MM(e) {
if (ob) {
if (N) {
ob.style.left = X0+e.pageX-X;
ob.style.top = Y0+e.pageY-Y;
}
else {
ob.pixelLeft = event.clientX-X + document.body.scrollLeft;
ob.pixelTop = event.clientY-Y + document.body.scrollTop;
return false;
}
}
}
function MU() {
document.onmousemove = null;
}
</script>
</body></html> |
Partager