I have a code for changing CSS when scroll value >= 500:
var appearScroll = function(){
let fline = document.getElementById("skills__listone");
var skills = document.getElementById("skills");
var baselocation = 0;
fline.style.opacity = 0;
var distance = window.pageYOffset;
window.addEventListener("click", function(){
if ( distance >= 600 ){
fline.style.opacity = 1;
}
})
};
appearScroll();
This works only one time for example when scroll value is 200 and I click the mouse, there are nothing happens(It is ok, because distance >= 600), but when scroll value, for example 700, there are nothing happens, because click function already was running. the function have to observe for the distance value and depend on IT make a result
Aucun commentaire:
Enregistrer un commentaire