I've made a simple code to change the value of a scrollbar along with document.scrollTop but i can't get it to work.Can someone tell me where i've made a mistake(s) ?
var scroll = document.scrollTop;
var container = document.getElementById('test');
container.innerHTML = scroll;
var pb = document.getElementById('progress-bar');
pb.value = 2;
var change = function()
{ pb.value = 2;
pb.value++;
};
if (scroll > 0){
change();
};
Aucun commentaire:
Enregistrer un commentaire