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
| <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nouvelle page 1</title>
<style type="text/css">
html, body {
height:100%
width:100%;
}
body{
overflow:hidden;
margin:0;
}
#footer { position:absolute;
bottom:-75px;
background-color:pink;
height:100px;
width:100%;
}
#contenu { height:25px;
background-color:red;}
</style>
<script type="text/javascript">
var running
var start, finish, span, pos, action
var way=1
function up(obj){
pos=parseInt(obj.offsetTop,10)
if(pos>finish){ obj.style.top=pos-1+"px"; }
else{ way=0;
clearInterval(myaction);
running=false;
}
}
function down(obj){
pos=parseInt(obj.offsetTop,10)
if(pos<finish){
obj.style.top=pos+1+"px"}
else{ way=1;
clearInterval(myaction);
running=false;}
}
function launch(mydiv,Do){
if (running==true){return false;}
running=true
span=parseInt(mydiv.offsetHeight,10)
start=parseInt(mydiv.offsetTop,10)
finish=(way==1)?start-span+25:start+span-25
myaction=(Do=='up')?setInterval(function(){up(mydiv)},1): setInterval(function(){ down(mydiv)},1);
}
</script>
</head>
<body >
<div id="footer" onmouseover="launch(this,'up')" onmouseout="launch(this,'down')">
<div id="contenu"> le footer </div>
la partie cachée
</div>
</body>
</html> |
Partager