/*
Show/Hide All Elements by Tag Name
--
By: Matt Atkins
Allows you to hide all elements on an HTML page by their tag
name. Extremely handy in getting around the "Windowless Elements"
problem in IE, which is a bug that puts certain elements, most
commonly select boxes, on top of any other element, no matter
what. As you can imagine, this causes real problems with DHTML
drop-down menus and such like. This is the simplest and quickest
fix I've come up with, I simply set this function to run
alongside the drop-down and all of the select tags vanish before
a menu drops, then I run the show function when the menu
retracts.
*/
function showAllByTag(tagName,dispType) {
var elements = document.getElementsByTagName(tagName);
var i = 0;
if (dispType == "") {
dispType = inline;
}
while (i < elements.length) {
elements[i].style.display = dispType;
i++;
}
}
function hideAllByTag(tagName) {
var elements = document.getElementsByTagName(tagName);
var i = 0;
while (i < elements.length) {
elements[i].style.display = "none";
i++;
}
}
9 Ağustos 2007 Perşembe
Show/Hide All Elements by Tag Name
Subscribe to:
Kayıt Yorumları (Atom)
0 Comments:
Post a Comment