ResizeJS
Resize JS is a tiny plugin to implement responsive events
Install
npm install --save resizejs
Usage
Basic
; const resp = ;window;
On orientation change
; const resp = enableOrientationChange: true;window;
Customize breakpoints
; const resp = breakpoints: mobile: 320 mobileLarge: 414 tablet: 768 tabletLarge: 1024 desktop: 1200 ;window;
Only when base media changes
For example: Tablet to Desktop or Mobile to Tablet
; const resp = breakpoints: mobile: 320 mobileLarge: 414 tablet: 768 tabletLarge: 1024 desktop: 1200 ;window;
Note
This library uses window.matchMedia
. To support old browsers please use a polyfill.