Expand Sections

W

WStoreyII

When i am looking through the msdn i always see these buttons that when you
click them a new page or paragraph ect. appears and the other content is
pusshed down how is this affect achieved.

WStoreyII
 
B

Ben Lovell

Hi,

Use something similar to the following:

<!-- start -->

<script>
function ShowHideContent()
{
if(document.all['divHidden'].style.display == 'none')
{
document.all['divHidden'].style.display = 'block';
}
else
{
document.all['divHidden'].style.display = 'none';
}
}
</script>
<a href="javascript:ShowHideContent();">Click Me</a>
<div style="display:none" id="divHidden" name="divHidden">
Hello, this is a test!
</div>

<!-- end -->

This works by dynamically setting the display CSS property of the DIV.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top