Skip to content

Latest commit

 

History

History

pixelsDisplayed

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

pixelsDisplayed

A module for detecting whether an element is located within the viewport

Usage

var bvUIPixelsDisplayed = require('bv-ui-core/lib/pixelsDisplayed');
var pixelsDisplayedVertical = bvUIPixelsDisplayed.pixelsDisplayedVertical;
var pixelsDisplayedHorizontal = bvUIPixelsDisplayed.pixelsDisplayedHorizontal;


if (pixelsDisplayedVertical(element) > 0) {
  // element is vertically within viewport
  if (pixelsDisplayedHorizontal(element) > 0) {
    // element is both vertically and horizontally within viewport
  }
}