Initial commit to github
This commit is contained in:
12
static/js/modules/GetHeaderHeight.js
Normal file
12
static/js/modules/GetHeaderHeight.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Get Header Height
|
||||
* -
|
||||
* Get header height and set CSS variable "--hgtHeader" to the header height.
|
||||
*/
|
||||
|
||||
function getHeaderHeight() {
|
||||
const headerHeight = document.querySelector('.header__nav-main').getBoundingClientRect().height;
|
||||
document.documentElement.style.setProperty('--hgtHeader', `${headerHeight}px`);
|
||||
}
|
||||
|
||||
export default getHeaderHeight;
|
||||
Reference in New Issue
Block a user