Last active
September 22, 2019 11:02
-
-
Save raazon/a3b7d32efadc14336f56c95b4e27c4dc to your computer and use it in GitHub Desktop.
Dynamic page content margin for fixed 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
(function ($) { | |
"use strict"; | |
// ========== Dynamic page content margin for fixed header JS Start ========== | |
$(window).on('resize load', function () { | |
var headerHeight = jQuery('#header').outerHeight(); | |
var pageContentWrap = jQuery('#page-content-wrapper'); | |
if(pageContentWrap.length){ | |
pageContentWrap.css('margin-top', headerHeight); | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment