|
// dans l'en-tête de votre document, placez ce script
:
<script language="JavaScript">
function seeLay(e){
x = "pageX";
y = "pageY";
if (document.layers) {
a = "";
}
if (document.all) {
a = document.body.scrollTop
e = window.event;
}
haut = e.y - 20 + a;
droite = e.x + 140;
bas = e.y + 20 + a;
gauche = e.x - 20;
if (document.layers) {
document.layers['theLayer'].clip.left = gauche;
document.layers['theLayer'].clip.top = haut;
document.layers['theLayer'].clip.right = droite;
document.layers['theLayer'].clip.bottom = bas;
}
else if (document.all) {
document.all['theLayer'].style.clip = "rect(" +
haut + " " + droite + " " + bas + "
" + gauche + ")";
}
}
function start(){
if (document.layers){
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove = seeLay;
}
else if (document.all){
document.onmousemove=seeLay;
}
}
</script>
// dans le document :
<div id="theLayer" style="position:absolute;
left:0px; top:0px; width:584px; height:394px; z-index:1; clip:
rect(0 0 0 0)">
<img src="images/image.jpg" width="584"
height="394" border="0">
</div>
<img name="image2" src="images/image2.jpg"
width="584" height="394" border="0">
// pour apeller le script :
onLoad="start()" |