|
Vorhang öffnen
...funktioniert nur mit Internet Explorer :-) Sourcecode:
<head>
<style>
.curtain { position:absolute; left:0; top:0; background-color:#aaa; border:3px solid navy }
</style>
</head>
<body>
<div id="c1" class="curtain" align="center"></div>
<div id="c2" class="curtain" align="center"></div>
<script language="JavaScript1.2">
var speed=1
var temp=new Array()
var temp2=new Array()
if (document.layers){
for (c=1;c<=2;c++){
temp[c]=eval("document.c"+c+".clip")
temp2[c]=eval("document.c"+c)
temp[c].width=window.innerWidth
temp[c].height=window.innerHeight/2
temp2[c].top=(c-1)*temp[c].height
}
}
else if (document.all){
var curtainbottom=document.body.offsetHeight/2,curtaintop=0
for (c=1;c<=2;c++){
temp[c]=eval("document.all.c"+c+".style")
temp[c].width=document.body.clientWidth
temp[c].height=document.body.offsetHeight/2
temp[c].top=(c-1)*parseInt(temp[c].height)
}
}
function openit(){
window.scrollTo(0,0)
if (document.layers){
temp[1].bottom-=speed
temp[2].top+=speed
if (temp[1].bottom<=0)
clearInterval(stopit)
}
else if (document.all){
curtainbottom-=speed
temp[1].clip="rect(0 auto+"+curtainbottom+" 0)"
curtaintop+=speed
temp[2].clip="rect("+curtaintop+" auto auto)"
if (curtainbottom<=0)
clearInterval(stopit)
}
}
function gogo(){
stopit=setInterval("openit()",10)
}
gogo()
</script>
|