Skip to content

Instantly share code, notes, and snippets.

@jentheo
Last active March 15, 2019 19:37
Show Gist options
  • Save jentheo/231b510bd0be7ded0d5e4aa76ff570ed to your computer and use it in GitHub Desktop.
Save jentheo/231b510bd0be7ded0d5e4aa76ff570ed to your computer and use it in GitHub Desktop.
Fix issue with et-fixed-header not being applied on single event pages in Divi
<script>
(function($) {
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 100) {
//clearHeader, not clearheader - caps H
$("#main-header").addClass("et-fixed-header");
}
});
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll < 100) {
//clearHeader, not clearheader - caps H
$("#main-header").removeClass("et-fixed-header");
}
});
})( jQuery );</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment