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 61 62 63 64 65 66 67 68 69 70 71 72
   | <HTML>
<HEAD>
<TITLE>Curseur Cible</TITLE>
<style type="text/css">
#Larg, #Haut
{ 
position:absolute; 
top:0;
left:0;
width:1px; 
height:1px; 
background-color:#FF6A22; 
z-index:100; 
font-size:1px;
} 
</style> 
<script type="Text/JavaScript">
function SuivreSourisIE()//~~ déplacement avec IE ~~
{ Larg.style.width=(document.body.scrollLeft+document.body.clientWidth);
Haut.style.height=(document.body.scrollTop+document.body.clientHeight);
if ( event.clientY < (document.body.clientHeight) )
{
Larg.style.top=(document.body.scrollTop+event.clientY);
}
if ( event.clientX < (document.body.clientWidth) )
{ 
Haut.style.left=(document.body.scrollLeft+event.clientX);
}
} 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function SuivreSourisFF(Pos) //~~ déplacement avec FF ~~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
Larg.style.width=(document.body.scrollLeft+window.innerWidth);
Haut.style.height=(document.body.scrollTop+window.innerHeight);
document.getElementById("Larg").style.top=(Pos.pageY);
document.getElementById("Haut").style.left=(Pos.pageX);
}
</script>
</HEAD>
<BODY>
<div id="Larg"
style=" width:100%;
height:1"></div>
<div id="Haut" 
style=" height:100%;
width:1"></div>
</BODY>
<script type="Text/JavaScript">
 
switch (navigator.appName) 
{
// ================================
case "Microsoft Internet Explorer":
// ================================
document.onmousemove=SuivreSourisIE;
break;
// =============================
case "Netscape": // FireFox...
// =============================
document.getElementById("Larg").style.width=window.innerWidth;
document.getElementById("Haut").style.height=window.innerHeight;
window.captureEvents(Event.MOUSEMOVE);
window.onmousemove=SuivreSourisFF;
break;
// ==============
default:// sinon ?
// ==============
break; 
} 
</script>
</HTML> | 
Partager