Breakpoints.js allows you to trigger JS callbacks when the document is ready, or when the window is resized.
$.breakpoints.min(<width>, <callback>, <data>);
$.breakpoints.max(<width>, <callback>, <data>);
$.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
// 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);
- jQuery
- O2 Raf (requestAnimationFrame handler)