...

View Full Version : check style hidden status?



6arredja
01-05-2007, 02:57 AM
how do you check the status of a div?



<div id="home" style="display:none;">


here it is not displayed or 'hidden'
how do i check for this and also how would i manipulate it so it can be toggled
on the fly so i won't have to reload the page?

Arbitrator
01-05-2007, 03:06 AM
how do i check for this and also how would i manipulate it so it can be toggledThat depends on what type of toggle you want to have (when it’s clicked, hovered, et cetera). You could do something like this:


if (element.style.display == "none") element.style.display == "";

6arredja
01-05-2007, 03:14 AM
if (element.style.display == "none") element.style.display == "";

instead of element would i put:


document.getElementById('home').style.display

?

i think i've got it now thanks arbitrator

Arbitrator
01-05-2007, 03:16 AM
Assuming you want to target an element with an ID of “home”, yes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum