[Javascript] See if item is hidden...

jsWalter jsWalter at torres.ws
Tue Jun 22 15:33:26 CDT 2004


> -----Original Message-----
> From: javascript-bounces at LaTech.edu 
> [mailto:javascript-bounces at LaTech.edu] On Behalf Of Paul Novitski
> Sent: Tuesday, June 22, 2004 1:09 PM
> To: [JavaScript List]
> Subject: Re: [Javascript] See if item is hidden...
> 
> At 10:50 AM 6/22/2004, jsWalter wrote:
> > Anyone have any idea how I can discover if a page item is 
> > hidden if it is a child of some other element?
> ...
> > Now, the user turns "off" DIV 'a' and everything it has disappears.
> 
> 
> Walter,
> 
> It depends on what mechanism you're using to hide the div.  
> Parsing the stylesheet is hard but possible (see 
> http://dean.edwards.name/IE7/); much easier would be to set 
> the inline style or the class name of the grandparent DIV.
> 
> If oP is your P tag, oP.parentElement.parentElement would be 
> the containing 
> DIV, and oP.parentElement.parentElement.style.visibility or 
> oP.parentElement.parentElement.style.display or 
> oP.parentElement.parentElement.className would likely contain the 
> information you need.

1) I really won't know how far down my Pa21 might be.
   (Yes, another of Walters "generic" code pieces)

2) its ancestor would be turned off by JS via a code switch
   but then again, its default state (via CSS) could have it "off"

Walter





More information about the Javascript mailing list