471,627 Members | 1,107 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

swf overlay

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.
Oct 9 '07 #1
3 4747
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
Oct 10 '07 #2
Thanks for the response let me give it a try and I'll get back to you later.


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
Oct 10 '07 #3
Thanks for the code. The only problem that I'm having is that the div tag is overlaying my button and I can't click on it. What can I do.
Oct 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Fabri | last post: by
9 posts views Thread by Ross | last post: by
reply views Thread by Never Best | last post: by
1 post views Thread by sendhil | last post: by
reply views Thread by odie5533 | last post: by
9 posts views Thread by Chuck Anderson | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.