Copiez le code comme suit :
<!DOCTYPE HTML>
<html>
<tête>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Publicité flottante plein écran JS</title>
<style type="text/css">
div#roll{width:100px;height:100px; background-color:#000; couleur:#fff; position:absolue;}
</style>
</tête>
<corps>
<div>
<div><h2>Publicité flottante JS plein écran, déplacez le curseur pour arrêter de bouger・Ke Leyi</h2></div>
</div>
<div id="roll">Je fais de la publicité<br />www.jb51.com</div>
<script type="text/javascript">
var ggRoll = {
rouleau : document.getElementById("rouleau"),
vitesse: 20,
statutX : 1,
statutY : 1,
x : 100,
y : 300,
winW : document.documentElement.clientWidth - document.getElementById("roll").offsetWidth,
winH : document.documentElement.clientHeight - document.getElementById("roll").offsetHeight,
Aller : fonction () {
this.roll.style.left = this.x + 'px';
this.roll.style.top = this.y + 'px';
ceci.x = ceci.x + (this.statusX ? -1 : 1)
si (this.x < 0) { this.statusX = 0 }
si (this.x > this.winW) { this.statusX = 1 }
ceci.y = ceci.y + (this.statusY ? -1 : 1)
si (this.y < 0) { this.statusY = 0 }
si (this.y > this.winH) { this.statusY = 1 }
}
}
var intervalle = setInterval("ggRoll.Go()", ggRoll.speed);
ggRoll.roll.onmouseover = function () { clearInterval(intervalle) };
ggRoll.roll.onmouseout = function () {intervalle = setInterval("ggRoll.Go()", ggRoll.speed) };
</script>
</corps>
</html>