Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xoxco/breakpoints
Trigger jQuery events for your responsive design breakpoints!
https://github.com/xoxco/breakpoints
Last synced: about 2 months ago
JSON representation
Trigger jQuery events for your responsive design breakpoints!
- Host: GitHub
- URL: https://github.com/xoxco/breakpoints
- Owner: xoxco
- Archived: true
- Created: 2011-11-15T22:31:35.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2011-11-30T04:30:03.000Z (almost 13 years ago)
- Last Synced: 2024-05-23T05:32:37.648Z (4 months ago)
- Language: JavaScript
- Homepage: http://xoxco.com/projects/code/breakpoints/
- Size: 160 KB
- Stars: 563
- Watchers: 29
- Forks: 88
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/xoxco/breakpoints)
[View Demo](http://xoxco.com/projects/code/breakpoints/)
Created by [XOXCO](http://xoxco.com)
## 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() {
...
});