I have code that uses jquery.slideup and jquery.slidedown
How can i know that div is hidden?
Answer: Use the jQuery :visible Selector You can use the jQuery :visible selector to check whether an element is visible in the layout or not. This selector will also select the elements with visibility: hidden; or opacity: 0; , because they preserve space in the layout even they are not visible to the eye.
You can use .is(':visible') selects all elements that are visible.
To see if an element is visible or not, you can use the visible selector with the is function:
$("#idElement").is(":visible") // true or false
But sounds to me like you want to toggle the slide effect, for that you can use the slideToggle function.
$('#id').is(':hidden'); //true if is hidden $('#id').is(':visible'); //true if is visible
But you may want to use slideToggle for your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With