Hi there:
I have used the code available on W3schools but when I use it on my localhost, it jitters at one point, so it is not smooth. What causes this, does anybody know?
It only does that at the beginning.
If you scroll fast it does not show but when I was testing it slowly it just looked like it was on speed or something.
Your help is appreciated.
<script type="text/javascript">
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop >100) {
document.getElementById("header").style.height = "50px";
} else {
document.getElementById("header").style.height = "100px";
}
}
</script>