Try this:

$(div.foo+':hidden').doThis();
$(div.foo+':visible').doThat();

jQuery supports ":hidden" and ":visible" selectors which will only select hidden or visible things.

On 9/29/06, Onno Timmerman <[EMAIL PROTECTED]> wrote:
Hi,

I was wondering how do you put if else situations in Jquery. For example:

if ($(div.foo).css("display") == "none")
        {
        do this
        }
else
        {
        do that
        }

If something is open it needs to be closed first before something else
will be openend. I have problems to get this in clear code. Maybe it
could be taken up in the tutorial?

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to