Skip to content

chunpu/is-visible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isvisible

Build status NPM version Downloads Dependency Status

Check if the element is visible and clickable

Installation

npm i isvisible

Usage

isVisible will check if a element is

  • overflow: hidden by parent node
  • opacity: 0 on self or parent node
  • display: none visibility: hidden hidden: true on self or parent node
  • Covered by other element

Use with browserify

var isVisible = require('isvisible')
console.log(isVisible(element))

Use isvisible.js Directly https://cdn.rawgit.com/chunpu/is-visible/gh-pages/browser/browser.js

Advanced

Check strictly

isVisible(element, true)

strict check will check

  • opacity > 0.9
  • top left point and mid point is not covered by other element

Support

Firefox, Chrome... even IE6+

IE9- cannot support opacicy set inherit from parent check

Where to Use

Make sure your AD and Promotion are really show in web pages

License

License

About

Check if the element is visible and clickable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published