[jQuery] how to if else situation with fx (tutorial request)

[jQuery] how to if else situation with fx (tutorial request)

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
discuss@jquery.com
http://jquery.com/discuss/