Skip to content

Instantly share code, notes, and snippets.

@dustintheweb
Last active December 16, 2015 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustintheweb/5446004 to your computer and use it in GitHub Desktop.
Save dustintheweb/5446004 to your computer and use it in GitHub Desktop.
Nicely animate your responsive breaking points
// >> Pretty Resize >>>>>>>>>>>>>>>>
// prereq: debounce: https://github.com/cowboy/jquery-throttle-debounce
function prettyResize(){
var a = '.element-1', // elements resizing
b = '.element-2',
c = '.element-3',
d = '.element-4',
rollout = $('' + a + ',' + b + ',' + c + ',' + d + '');
$(window).on( 'resize', $.debounce(10,
function(){
rollout.css({'transition' : 'all 0.5s ease-in-out'});
})
);
}
prettyResize();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment