3 <title>Block Collapse Demo
</title>
5 function toggleBlock( pBlockName
)
7 var theImage
= document
.getElementById( "I-" + pBlockName
)
8 var theBlock
= document
.getElementById( "T-" + pBlockName
)
10 if (theImage
.alt
== "shown")
12 theImage
.src
= "resources/closed.png"
13 theImage
.alt
= "hidden"
14 theBlock
.style
.visibility
= "hidden"
15 theBlock
.style
.position
= "absolute"
19 theImage
.src
= "resources/open.png"
20 theImage
.alt
= "shown"
21 theBlock
.style
.position
= "static"
22 theBlock
.style
.visibility
= "visible"
27 <body onload=
"document.body.offsetTop; toggleBlock('Alpha')">
28 <h2>Block Collapse Demo
</h2>
29 <p>This table below has three hierarchical sections. Collapsing a section should cause those below it to move up.
</p>
30 <p>This works on the latest Windows IE and Mozilla Firefox (Win and Mac) but not on Safari
1.2.3 (v125.9) {or
2.0 (
146)}.
</p>
31 <p>Note that the second section is collapsed when the page opens and expanding it works fine. Just the collapse is broken.
</p>
36 <div onclick=
"toggleBlock('Alpha')" style=
"font-weight:bold;cursor:pointer;"><img src=
"resources/open.png" alt=
"shown" id=
"I-Alpha"> Block One
</div>
39 <tr><td width=
30> </td><td>This is the
</td></tr>
40 <tr><td width=
30> </td><td>contents of
</td></tr>
41 <tr><td width=
30> </td><td>block one.
</td></tr>
45 <div onclick=
"toggleBlock('Beta')" style=
"font-weight:bold;cursor:pointer;"><img src=
"resources/closed.png" alt=
"hidden" id=
"I-Beta"> Block Two
</div>
47 <div id=
"T-Beta" style=
"visibility:hidden;position:absolute;">
49 <tr><td width=
30> </td><td>This is the
</td></tr>
50 <tr><td width=
30> </td><td>contents of
</td></tr>
51 <tr><td width=
30> </td><td>block two.
</td></tr>
55 <div onclick=
"toggleBlock('Gamma')" style=
"font-weight:bold;cursor:pointer;"><img src=
"resources/open.png" alt=
"shown" id=
"I-Gamma"> Block Three
</div>
59 <tr><td width=
30> </td><td>This is the
</td></tr>
60 <tr><td width=
30> </td><td>contents of
</td></tr>
61 <tr><td width=
30> </td><td>block three.
</td></tr>