|
To add a foldable section to a web page follow the instructions
below.
Example of a foldable section:
Click to show/hide
any product description
|
This is any product
description.
This is any product
description.
This is any product
description.
|
Note: Change
the values listed in red to
match your specific needs.
1. Proceed to the Visual
Editor page.
2. Switch to HTML mode and add the following code between
<BODY> and </BODY> tags.
To make a collapsed section, use the following code:
|
<b><a href="#" id="handle1" onclick="toggle('1')">Show</a></b>
<div id="content1" style="display:none">
<P>Put your text here.</P>
</div>
|
To make an expanded section, use the following code:
|
<b><a href="#" id="handle1" onclick="toggle('1')">Hide</a></b>
<div id="content1">
<P>Put your text here.</P>
</div>
|
You can add several foldable sections to a web page changing the
figure "1" in the code above to "2", "3" etc.
3. Add the following code to the JavaScript
OnLoad event:
|
window.toggle = function(id)
{
if (document.getElementById('content'+id).style.display == 'none')
{
document.getElementById('content'+id).style.display = 'block';
document.getElementById('handle'+id).innerHTML = 'Hide';
}
else
{
document.getElementById('content'+id).style.display = 'none';
document.getElementById('handle'+id).innerHTML = 'Show';
}
}
|
|