Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Garconis/40610091834935768d305a70ad8fff53 to your computer and use it in GitHub Desktop.
Save Garconis/40610091834935768d305a70ad8fff53 to your computer and use it in GitHub Desktop.
Divi | Force centered header to use regular mobile header
// https://divibooster.com/use-default-mobile-menu-with-the-centered-inline-logo-header/
(function($) {
function resize() {
$window = $(window);
$body = $('body');
if ($window.width() < 981) {
$body.addClass('et_header_style_left');
$body.removeClass('et_header_style_split');
} else {
$body.removeClass('et_header_style_left');
$body.addClass('et_header_style_split');
}
}
setTimeout(function(){
$(window)
.resize(resize)
.trigger('resize');
}, 100);
})(jQuery);
// May also want to add this css:
// @media only screen and (max-width: 980px) { .et_header_style_split #main-header { visibility:hidden; } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment