Hi everyone,
I'm having problem with my html code. I'm new to the html programming so please bare with me. The problem that I'm having is that I have a swf file that i have placed in a div tag. This div tag is overlaying the web page, which it is intended to do so. The swf play automatically when the page is loaded. Is there a way that I can collapse the div tag? Because i want the button that i have created to expand the div tag to play the swf file.
In the head section of your document add this:
[HTML]<script type="text/javascript">
function toggleVisibilit y()
{
if (document.getEl ementById('div id').style.disp lay==none)
{
document.getEle mentById('div id').style.disp lay="block";
}
else
{
document.getEle mentById('div id').style.disp lay="none";
}
}
</script>[/HTML]
div id is the id of the div
then add this to the div tag:
[HTML]style="display: none;"[/HTML]
and in the button input tag add this:
[HTML]onclick="toggle Visibility()"[/HTML]
because we are using display, when the value is "none" the surrounding elements might "collapse" and fill the space where the div used to be
If you still want the "presence" of the div to be there without displaying it though, you use visibility="vis ible" and visibility="hid den" instead of display="none" and display="block"
Hope this makes sense