JQuery slideToggle() current show/hide state property?

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.

Answers


I think you can do something like this,

if($("#panel").is(":hidden"))
{
    // do stuff
}

Need Your Help

Session/cookie management in Apache JMeter

java session cookies jmeter session-cookies

We have a simple performance test flow in an application.

Flatten an array of strings in Ruby

ruby

What's the best idiomatic (cleanest) way to convert an array of strings into a string, while keeping the enclosing quotes for each elements.