Skip to content

Instantly share code, notes, and snippets.

@tsavory
Created June 5, 2012 19:02
Show Gist options
  • Save tsavory/2877015 to your computer and use it in GitHub Desktop.
Save tsavory/2877015 to your computer and use it in GitHub Desktop.
change sidebars columns depending on layout css
(function ($) {
Drupal.behaviors.yourfunction = {
attach: function(context) {
$('body', context).once('responsetoggle', function () {
$('body').bind('responsivelayout', function (e, d) {
if (d.to == 'narrow') {
$('#region-content').removeClass('grid-8');
$('#region-content').addClass('grid-7');
$('#region-sidebar-second').removeClass('grid-4');
$('#region-sidebar-second').addClass('grid-5');
}
if (d.to != 'narrow') {
$('#region-content').removeClass('grid-7');
$('#region-content').addClass('grid-8');
$('#region-sidebar-second').removeClass('grid-5');
$('#region-sidebar-second').addClass('grid-4');
}
});
});
}
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment