Skip to content

antonia-rose/in-viewport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

In Viewport

Compares a specified pixel value with the current window width.

How to use

Define your viewports:

var viewport = new inViewport();

viewport.setViewports({
    'mobile': 586,
    'portrait': 768,
    'desktop': 1024
});

There are several ways to ask for your viewport:

viewport.is(200);
viewport.is('<=500px');
viewport.is('<portrait');

Methods

  • is(String|Number): returns true|false if the current window width accords to the given param
  • setViewports(Object): expects a object with viewports (see example ahead)
  • addViewport('String', number): Adds a new viewport to the viewport set
  • getViewports(): Returns a object with all defined viewports

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published