function scroll1(){ window.scrollBy(0,350); } function scroll2(){ window.scrollBy(0,-350); }
var stopBtn = document.getElementById("stopBtn"); stopBtn.disabled = true; function sample2Func(){ scrollBy(0,2); var s2Btn = document.getElementById("s2Btn"); s2Btn.disabled = true; stopBtn.disabled = false; var scroll = setTimeout("sample2Func()", 100); stopBtn.onclick = function(){ clearTimeout(scroll); s2Btn.disabled = false; stopBtn.disabled = true; } }