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
|
<script type='text/javascript'>
var moving
function moveright(obj){
posleft=parseInt(obj.style.left)
if (posleft<200){
posleft++;
obj.style.left=posleft+'px';}
else{
clearInterval(moving)
}
}
function action(){
document.getElementById('div2').style.visibility='visible';
setTimeout(function(){
document.getElementById('div1').style.visibility='visible';
var moving=setInterval("moveright(document.getElementById('div1'))",10);
},1000);
}
</script>
</head>
<body onload="" >
<div id="div0" style="position:absolute; z-index:4;top:100px; left:1px; width:100px;height:100px;background-color:red;border:solid 1px gray;"> </div>
<div id="div1" style="position:absolute; z-index:3;visibility:hidden;top:100px; left:0px; background-color:transparent;margin-top:50px; font-family:verdana;">message sortant</div>
<div id="div2" style="position:absolute; z-index:2; visibility:hidden;top:100px; left:101px; width:1x;height:1px;border:solid 40px white;border-left:solid 40px red;"> </div>
<input type='button' onclick='action()' value='go' />
</body>
</html> |
Partager