Created
March 13, 2018 15:53
-
-
Save Garconis/40610091834935768d305a70ad8fff53 to your computer and use it in GitHub Desktop.
Divi | Force centered header to use regular mobile header
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
// 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