DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Aniruddha has posted 40 posts at DZone. View Full User Profile

JQuery: Check If Element Is Visible

10.14.2011
| 3202 views |
  • submit to reddit
        // here parameter element is a jquery wrapped object and not html element


function isVisible(element){
   if(elem.is(":visible")){
     return true;
   }
   else{
     return false;
   }
}

You would use it like below
 if(isVisible($('#elementId')){
   alert("Visible");
 }