Efecto de apertura en javascript

Para ver el ejemplo da clic aquí
<HTML>

<HEAD>

<TITLE>Efecto apertura</TITLE>

<style>

.curtain{

position:absolute;

left:0;

top:0;

layer-background-color:004080;

background-color:004080;

border:0.1px solid PURPLE

}

</style>

</HEAD>


<BODY bgColor=#ffffff leftMargin=0 rightMargin=0 topMargin=0>


<div id="c1" class="curtain"></div><div id="c2" class="curtain"></div>

<script language="JavaScript1.2">


var speed=15

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()",60)

}

gogo()

</script>

<p align="center"><font size="7">www.uterra.com</font></p>

</body>


</html>


Efecto de apertura en javascript Efecto de apertura en javascript Reviewed by Marcos Rivas Rojas on miércoles, noviembre 26, 2008 Rating: 5