Join date:2006-12-12 02:37:22
Posts: 27
Posts: 27
I have been asked whether I could modify the coding of this script:
http://www.linkstraffic.net/programming/javascript/movediv.php
to cause the box to slide up instead of being revealed down.
here is what I come up with using only relative position:
Well I'm pretty sure we can enhance it;
does anyone else has any ideas?
we shall also try using absolute position.
Cheers.
http://www.linkstraffic.net/programming/javascript/movediv.php
to cause the box to slide up instead of being revealed down.
here is what I come up with using only relative position:
<html>
<head>
<style type="text/css">
#box{width:200px;height:0.1em;background-color:pink;overflow:hidden}
#inbox{background-color:white;width:200px;height:120px}
</style>
<script type="text/javascript">
hh=120;
hhh=0;
function show()
{
if(hh==2)
{
clearInterval(inter);
return;
}
obj = document.getElementById("inbox"
;
obj1 = document.getElementById("box"
;
hhh+=2
hh-=2;
obj.style.height = hh + 'px';
obj1.style.height = hhh + 'px';
}
</script>
</head>
<body>
<div id="box">
<div id="inbox"></div>
Some text here!<br />
more text<br/>
more text<br />
<p>
still more text</p>
</div>
<a href="#" onclick="setInterval('show()',3);return false;">Click here to show the box</a>
</body>
</html>
<head>
<style type="text/css">
#box{width:200px;height:0.1em;background-color:pink;overflow:hidden}
#inbox{background-color:white;width:200px;height:120px}
</style>
<script type="text/javascript">
hh=120;
hhh=0;
function show()
{
if(hh==2)
{
clearInterval(inter);
return;
}
obj = document.getElementById("inbox"
obj1 = document.getElementById("box"
hhh+=2
hh-=2;
obj.style.height = hh + 'px';
obj1.style.height = hhh + 'px';
}
</script>
</head>
<body>
<div id="box">
<div id="inbox"></div>
Some text here!<br />
more text<br/>
more text<br />
<p>
still more text</p>
</div>
<a href="#" onclick="setInterval('show()',3);return false;">Click here to show the box</a>
</body>
</html>
Well I'm pretty sure we can enhance it;
does anyone else has any ideas?
we shall also try using absolute position.
Cheers.
0110000101001
