No jQuery!
This is script that I got from Chris Buttery website. Or at least part of it:
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .05) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
}
The problem is that when I run it, it does work perfectly, but it jitters a lot. I can literally point out moments when that 5% of opacity is removed. Any ideas? It's not optimization of script, nor it's my weak computer. This script is about as clean as it gets and my laptop isn't trash either, so there must be something worth adding.