if ($('#somediv').css('display') != 'none' && $('#somediv').css('visibility') != 'hidden') {
// function or call
}
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
:visible is actually looking for display:none (and a couple of other circumstances) but (I understand) considers visibility: hidden as still being visible - since it still occupies space in the layout?!
I suppose most of the time this is not a concern as people tend to be confirming the application of show() or hide().
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
The :visible method will work fine in this case, but Andrew's method is not working for me, seems the if statement is being completely ignored and the function executes as if it weren't there. I was looking forward to using that method for other css properties as well, might you know why it isn't working?
.. and, of course, you've modified '#somediv' to the correct id for your own div element?
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 08-18-2012 at 02:09 PM..
If you do what Andrew suggested in the previous post you’ll see that the alert is giving the value of the attribute. That way you can check what comes out and whether it matches the condition.