node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

properjs-resizecontroller

ResizeController

Window resize / orientationchange event controller using request animation frame.

Installation

npm install properjs-resizecontroller --save-dev

Usage

var ResizeController = require( "properjs-resizecontroller" ),
    resizer = new ResizeController();
 
// Bind event 
resizer.on( "resize", function () {
    // Handle event here 
});

Events

  • resize
  • resizedown
  • resizeup
  • resizewidth
  • resizeheight
  • orientationchange
  • orientationportrait
  • orientationlandscape

Methods

  • on( event, handler )
  • getViewport() -> { width, height, orient }
  • isPortrait()
  • isLandscape()