exocintact
07-28-2009, 09:31 PM
Hi everyone,
I'm using an autoscroll feature on my webpage using javascript
and also implementing a reset button to bring the scroll to the very top
but the two are not being compatible.. the reset button DOES scroll to the top but when I click the start button again after its been reset it starts scrolling from where it last left off (and not back from the top).
Here's the code:
function back_to_top(id){
document.getElementById(id).scrollTop=0
}
i = 0
function scroll() {
i = i + speed
and the buttons:
<input onclick="scroll()" type="button" value="Start">
<input onclick="clearTimeout(t1)" type="button" value="Stop">
<br><input onclick="back_to_top('transcript')" type="button" value="Reset">
This is my final task for this site and this "glitch" is starting to get very frustrating. Any help would be greatly appreciated!
I'm using an autoscroll feature on my webpage using javascript
and also implementing a reset button to bring the scroll to the very top
but the two are not being compatible.. the reset button DOES scroll to the top but when I click the start button again after its been reset it starts scrolling from where it last left off (and not back from the top).
Here's the code:
function back_to_top(id){
document.getElementById(id).scrollTop=0
}
i = 0
function scroll() {
i = i + speed
and the buttons:
<input onclick="scroll()" type="button" value="Start">
<input onclick="clearTimeout(t1)" type="button" value="Stop">
<br><input onclick="back_to_top('transcript')" type="button" value="Reset">
This is my final task for this site and this "glitch" is starting to get very frustrating. Any help would be greatly appreciated!