Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery slideToggle() current show/hide state property?

Tags:

jquery

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.

like image 221
Craig Quillen Avatar asked Jul 15 '09 18:07

Craig Quillen


1 Answers

I think you can do something like this,

if($("#panel").is(":hidden")) {     // do stuff } 
like image 129
CalebHC Avatar answered Sep 22 '22 01:09

CalebHC