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
| <html>
<head>
<script language="JavaScript">
<!--
//PLF-http://www.jejavascript.net/
var hauteur=0;
var temps=30;
var max=30;
function position(left,top,width,height,contenu) {
hauteur=height;
var Z="<DIV id='CalqueImage' style='position:absolute;left:"+left+"; top:"+top+";width:"+width+"; height:"+height+"'>"+contenu+"</DIV>";
document.write(Z);
setTimeout("Start()",temps);
}
function Start() {
DeplacerImage("CalqueImage",Postionimage("CalqueImage"));
setTimeout("Start()",temps);
}
function DeplacerImage(nom,top) {
document.getElementById(nom).style.top = top;
}
function Postionimage(nom) {
var pos=parseInt(document.getElementById(nom).style.top);
var wintop=parseInt(document.body.scrollTop);
var dispo=document.body.clientHeight;
var diff=Math.ceil((pos-(wintop+dispo-hauteur)));
if (diff>max) {diff=max;}
if (diff<-1*max) {diff=-1*max;}
var top=pos-diff;
return top;
}
//-->
</script>
</head>
<body>
<script language="JavaScript">
<!--
//PLF-http://www.jejavascript.net/
//position(marge,1,largeur,hauteur(>H image),'image');
position(2,1,100,420,'<img src="images/logo5.jpg" width="88" height="32">');
//-->
</script>
</body>
</html> |
Partager