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 73 74 75 76 77 78 79 80 81 82
| <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
#desk-background-1{
width:2018px;
height:1666px;
position:relative;
top:20px;
left:0px;
}
#desk-background-2{
width:2018px;
height:1666px;
position:relative;
top:0px;
left:2018px;
margin-top:-1666px;
}
</style>
<script type="text/javascript">
var def={
oxo:0,
ixe:0,
igrec:0,
sensa:function(e){
var clic=document.getElementById('clic')
var omx=(clic.offsetLeft+(clic.offsetWidth/2))-def.ixe;
if(omx>100 || omx<-100){ //zone morte
clic.scrollLeft=clic.scrollLeft-Math.round(omx/20); //vitesse augmenter la division pour diminuer la vitesse
}
var omy=(clic.offsetTop+(clic.offsetHeight/2))-def.igrec;
if(omy>100 || omy<-100){ //zone morte
clic.scrollTop=clic.scrollTop-Math.round(omy/20); //vitesse augmenter la division pour diminuer la vitesse
}
},
souris:function(e){
e =(!e) ? window.event : e;
def.ixe=e.clientX;
def.igrec=e.clientY;
}
}
function init(){
var clic=document.getElementById('clic')
if(parseInt(navigator.userAgent.substring(30,31))<=8){
clic.attachEvent("onmousemove",def.souris);
}
else{
clic.addEventListener("mousemove", def.souris, false);
}
clic.style.height=document.documentElement.clientHeight+'px'
def.oxo=setInterval(def.sensa,30)
}
onload=init
</script>
</head>
<div id='clic' style='overflow:hidden;width:100%'>
<div>
<img src='http://fromtheroughmovie.com/uploads/desk/background-1.jpg' id='desk-background-1'>
<img src='http://fromtheroughmovie.com/uploads/desk/background-2.jpg' id='desk-background-2'>
</div>
</div>
</body>
</html> |
Partager