[Solved] Element’s opacity change when scrolled on point [closed]


#header:hover { opacity:1; } //CSS for mouse over #header

// javascript
var head = document.getElementById("header");
if (document.body.scrollTop > 400) 
    head.setAttribute("style","opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50)");
else
    head.setAttribute("style","opacity:1; -moz-opacity:1; filter:alpha(opacity=100)");

0

solved Element’s opacity change when scrolled on point [closed]