PDA

View Full Version : making divs visible?



MrCraig
02-02-2008, 04:16 PM
Hey :)

I know this will probably be really simple JS but i just cant figure it out..

I have this hidden div..



<div style="display:none;" id="content">Content...</div>


Does anyone know what the javascript would be to make it visible?

I was thinking about making the height = 0px and width = 0px so it wouldnt mess up the page layout. But does anyone know how to make it visible/another way to do it..

(Like a better styled popup window)

And NO DHTML DD LINKS PLS.

Invent
02-02-2008, 04:30 PM
<html>
<head>
<script type="text/javascript">
<!--

function hi(div)
{

document.getElementById(div).style.display = "block";

}

//-->
</script>
</head>

<body>

<div style="display:none;" id="content">Content...</div>
<br />
<a onClick="hi('content');">show</a>

</body>
</html>

MrCraig
02-02-2008, 04:31 PM
O.o

Knew it would be that simple rofl :P

ty Simon :D

Want to hide these adverts? Register an account for free!