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 toggleVisibility()
{
if (document.getElementById('div id').style.display==none)
{
document.getElementById('div id').style.display="block";
}
else
{
document.getElementById('div id').style.display="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="toggleVisibility()"[/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="visible" and visibility="hidden" instead of display="none" and display="block"
Hope this makes sense