[thelist] js hide layer function

Bob Davis bobd at lists.evolt.org
Tue Oct 3 15:04:18 CDT 2000


on 10/3/00 3:26 PM, Robert Stewart at rob at dieseldesign.com wrote:

> Would you mind sharing?
> 

Not at all:

function tmt_findObj(n){
    var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
    x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
    }else{x=document.getElementById(n)}return x;
}

function tmt_showhideAll(c){
    var v = (document.layers) ? ".visibility" : ".style.visibility";
    var arr = (document.layers) ? document.layers : (document.all) ?
document.all.tags("DIV") : document.getElementsByTagName("DIV");
    for(var i=0;i<arr.length;i++){eval("arr["+i+"]"+v+"='"+c+"'");}
}            

I got it at :
<wrap>
http://www.massimocorner.com/index.html?body$http://www.massimocorner.com/dw
/behaviors.htm

</wrap>

It's called 'Show-hide all Layers 1.0.1'

Works pretty well.

bob

-- 

bob davis
bobd at members.evolt.org





More information about the thelist mailing list