Last active
December 16, 2015 13:59
-
-
Save dustintheweb/5446004 to your computer and use it in GitHub Desktop.
Nicely animate your responsive breaking points
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// >> 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