Thursday, October 9, 2008

Layers over Embed Flash Objects - Issues Resolved Forever!

Catching Up - Starting with a small post.

I used to struggle with dhtml pop-ups and overlays - never getting them on TOP of flash or other embedded elements or objects.

That is a thing of the past when I invented this:

objtags = document.getElementsByTagName("EMBED");
for (x=0;x<objtags.length;x++) {
objtags[x].parentNode.style.visibility = "hidden";
}

That loops over all embedded objects and makes them invisible. (Not display:none; because that will affect the page layout.)

We put the above code in whatever javascript opens the layover. Inversely, we put the below script in the javascript function which closes the layover:

objtags = document.getElementsByTagName("EMBED");
for (x=0;x<objtags.length;x++) {
objtags[x].parentNode.style.visibility = "visible";
}

And that's a wrap!