Net-informations.com
SiteMap  | About    

How to Check an Element is Visible or not using jQuery



You can use .is(':visible') to check whether an element is visible in the layout or not.

Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero. The :visible selector selects every element that is currently visible.

run this source code Try it Yourself
Hidden Div
Visible Div

Full Source

Elements with visibility: hidden or opacity: 0 are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.

The same works with .is(':hidden') to check whether an element is visible in the layout or not.

run this source code Try it Yourself
Hidden Div
Visible Div

Full Source










net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.