• This repository has been archived on 15/Aug/2019
  • Stars
    star
    561
  • Rank 79,400 (Top 2 %)
  • Language
    JavaScript
  • Created almost 13 years ago
  • Updated almost 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Trigger jQuery events for your responsive design breakpoints!

Breakpoints.js

Define breakpoints for your responsive design, and Breakpoints.js will fire custom events when the browser enters and/or exits that breakpoint.

Get it from Github

View Demo

Created by XOXCO

Instructions

$(window).setBreakpoints({
// use only largest available vs use all available
	distinct: true, 
// array of widths in pixels where breakpoints
// should be triggered
	breakpoints: [
		320,
		480,
		768,
		1024
	] 
});		

$(window).bind('enterBreakpoint320',function() {
	...
});

$(window).bind('exitBreakpoint320',function() {
	...
});

$(window).bind('enterBreakpoint768',function() {
	...
});

$(window).bind('exitBreakpoint768',function() {
	...
});


$(window).bind('enterBreakpoint1024',function() {
	...
});

$(window).bind('exitBreakpoint1024',function() {
	...
});