Filed Under: General

ActiveX Controls always on top.
Hiding Elements with getElementsByClass.

4 May 2008 No Comment Tags: , , ,

It’s strange but a lot of elements like active-x controls are always on top of other div’s even if you defined a z-index:0 for that element and the div has a z-index:1.

An easy solution would be to hide the objects while the menu is active, this can be realized with a “getElementsByClass. ” functions, which I have found here webdesignblog.de.

Without a getelementbyclass it’s sometimes difficult to hide your navigation with javascript. This little script will help you to realize just that.

function hide() {
var allElems = document.getElementsByTagName('*');
for (var i = 0; i < allElems.length; i++) {
var thisElem = allElems[i];
if (thisElem.className && thisElem.className == 'CLASSNAME') {
thisElem.style.display = 'none';
}
}
}
 
 
function show() {
var allElems = document.getElementsByTagName('*');
for (var i = 0; i < allElems.length; i++) {
var thisElem = allElems[i];
if (thisElem.className && thisElem.className == 'CLASSNAME') {
thisElem.style.display = 'block';
}
}
}

Replace CLASSNAME with the name of your nav class.

Then simply call the script like that:

<li onmouseover=hide(); onmouseout=show();> navigation</li>

This is of course not a solution for embed window media player streams, because it will reload the stream everytime.
I’m currently trying to find a solution for the embed wmp.

Update:
Here is a solution for the embed wmp, I hope that can help you.
asp.net







Like our posts? Then subscribe via Mail:

Email:  

Similar Posts:

Socialize:

delicious stumbleupon

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.com.