Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reorder elements after a certain breakpoint
cmap.footer = {};
cmap.footer.checkForLayoutChange = function(){
var $footer = $('#footer'), $row = $footer.find('.row');
var $jump = $footer.find('.footer-jump-to-top');
var $pages = $footer.find('.footer-page-links');
var $social = $footer.find('.footer-social-links');
function clean(){
$jump.remove();
$pages.remove();
$social.remove();
}
function desktop(){
clean();
$row.append($jump);
$row.append($pages);
$row.append($social);
}
function mobile(){
clean();
$row.append($pages);
$row.append($jump);
$row.append($social);
}
function check(){
if(window.innerWidth < 1000){
mobile();
} else {
desktop();
}
}
check();
$(window).resize(_.throttle(check, 100));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.