How do i make my divs slide?
Hi guys, i have written a very basic javascript function so that when you click on a button selected divs either display or dissappear (see below).
<script language="javascript">
var divs=['header', 'middle', 'footer'];
function displaydiv()
{
for (var x=0;x<divs.length;x++)
{
document.getElementById(divs[x]);
if (document.getElementById(divs[x]).style.display=='block')
{
document.getElementById(divs[x]).style.display='none';
}
else
{
document.getElementById(divs[x]).style.display='block';
}
}
}
</script>
Is there anyway i can make these divs slide out rather than appear instantly? This would just make it look that little bit better. Someone mentioned that i could do this using javascript. Any ideas?
Cheers in advance
Will
|