xxxxxxxxxx
// sticky Header js plugin
let w_out_sticky = document.querySelector(".w-out")// terget class or id
// hear is scroll logic
window.addEventListener('scroll', () => {
window.scrollY > 300 ? w_out_sticky.classList.add("sticky") : w_out_sticky.classList.remove("sticky")
})
xxxxxxxxxx
let number;
window.onscroll = function(){
number = window.pageYOffset;
if(number > 10){
document.querySelector(".stick").style.background = '#fff';
}
else{
document.querySelector(".stick").style.background = 'none';
}
}