tags:

views:

886

answers:

1

What is the easiest way to programmatically find the current toggle state of a DOM element when using the slideToggle() function in jquery 1.3.2?

I expected there to be a property for this, but I can't seem to find one. Directly checking the CSS display or height seems like a hack, but maybe that's what one is expected to do.

+3  A: 

I think you can do something like this,

if($("#panel").is(":hidden"))
{
    // do stuff
}
CalebHC
I had actually gone with checking the css display property, but this would be cleaner.
Craig Quillen