Skip to content

jgiuffrida/breakdance.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

breakdance.js

Make that browser dance...

The goal of this script is provide a way to execute different pieces of javascript at resolution breakpoints, effectively turning the browser into a resolution based state machine. Each breakpoint specified has an user defined enter and exit function which will run once when the min/max width range is met.

Features

  1. Library Independent
  2. Crossbrowser support - Actual version statistics coming soon, IE6+ Support is confirmed.
  3. Run different javascript at various resolutions

Usage

  1. Include breakdance.js on page
  2. Create move or moves - breakdance excepts either option.
    var moves = [
    	{
    		min:0,
    		max:479,
    		enter: function() {
    			console.log('Enter 0-479');
    		},
    		exit: function() {
    			console.log('Exit 0-479');
    		}
    	},
    	{
    		min:480,
    		max:9999,
    		enter: function() {
    			console.log('Enter 480 and beyond');
    		},
    		exit: function() {
    			console.log('Exit 480 and beyond');
    		}
    	},
    ];
  1. Pass moves to breakdance
    breakdance(moves);
  1. $$$$

Coming Soon

  1. Min/Max only support
  2. More Crossbrowser testing/support/statistics
  3. Performance Improvements
  4. More Awesome

About

Call and response to make that browser dance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published