const setUpStickyHeader = () => {
let header = document.querySelector("#header");
toggleHeaderStickiness = () => {
if (window.scrollY > 0) {
header.classList.add("sticky-header");
} else {
header.classList.remove("sticky-header");
}
}
window.addEventListener("scroll", toggleHeaderStickiness);
}
window.addEventListener("DOMContentLoaded", setUpStickyHeader);
const setUpBurgerMenu = () => {
console.log("burger menu setup initiated...");
let burger = document.querySelector("#primary-menu-trigger");
let fries = document.querySelectorAll("#primary-menu > ul")
const toggleFries = () => {
console.log("fry toggling initiated...");
for (var i = 0; i < fries.length; i++) {
console.log("enter the fry loop...");
var fry = fries[i];
if (fry.classList.contains("show")) {
fry.classList.remove("show");
console.log("showed fry ", i);
} else {
fry.classList.add("show");
console.log("hid fry ", i);
}
}
}
burger.addEventListener("click", toggleFries);
}
window.addEventListener("DOMContentLoaded", setUpBurgerMenu);
// This opens the search bar
window.addEventListener("DOMContentLoaded", function(){
document.querySelector("#top-search-trigger").addEventListener("click", function(){document.querySelector("body").classList.toggle("top-search-open")})
});
// The body tag has to have this for the right header styles to get applied, and since we can't edit the body tag directly through Divi, this is easier than editing theme files...
window.addEventListener("DOMContentLoaded", function() {
document.querySelector("body").classList.add("stretched");
})
MODERN SPARE PART MANAGEMENT
Don't Forget about the hidden costs
This article is currently only available in German
SHARE THIS ARTICLE
RELATED ARTICLES
Quality: The Third Element in Overall Equipment Effectiveness
As Senior Manager and maintenance expert at T.A. Cook, Maximilian Tan is responsible for multinational excellence improvements projects and programs. He has more than 25 years of work experience and has managed complex maintenance and operations optimization projects for customers in the Oil & Gas up-, mid- and downstream incl. chemical and metallurgical industries.