Skip to content

erikagiroux/breakpoints

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

breakpoints.js

What it does

Breakpoints.js allows you to trigger JS callbacks when the document is ready, or when the window is resized.

How to use it

Resize Breakpoints

$.breakpoints.min(<width>, <callback>, <data>);
$.breakpoints.max(<width>, <callback>, <data>);

Initial Callbacks

$.breakpoints.initial.min(<width>, <callback>, <data>);
$.breakpoints.initial.max(<width>, <callback>, <data>);

width | integer : The width of the window that will trigger the callback(s)


callback | function or array : The callback(s) to be triggered


data | anything : Data you want to pass as argument for the callback function


Examples

// resize BP
$.breakpoints.min(768, [
    app.fn.kill_slider,
    app.fn.init_sticky
  ]);

$.breakpoints.max(768, [
    app.fn.kill_sticky,
    app.fn.init_slider,
  ]);

// initial BP
$.breakpoints.initial.min(768, app.fn.init_sticky);
$.breakpoints.initial.max(768, app.fn.init_slider);

Requirements

  • jQuery
  • O2 Raf (requestAnimationFrame handler)

About

JS breakpoints and responsive callbacks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%