![]() |
SELFHTML Forumsarchiv |
|
|
Die folgende Nachricht zum Thema stammt von: inSide-j00ls, 31. 08. 2005, 14:29
I have the following function that starts downward scrolling:
function NachUnten (mausaufbild) {
var aktiv = window.setInterval("window.scrollBy(0, +10)", 50);}
this works nicely - but calling a second function with clearInterval(aktiv); does not work - only calling clear at the same time cancels the scrolling process but then I cant scroll at all - even if I call the same function with a variable that decides whether or not to call clearInterval it never works. How can I reference the interval once I have started it ?
Help much appreciated!
Die folgende Nachricht zum Thema stammt von: Struppi, 31. 08. 2005, 14:37
»» function NachUnten (mausaufbild) {
»» var aktiv = window.setInterval("window.scrollBy(0, +10)", 50);}
»»
»» this works nicely - but calling a second function with clearInterval(aktiv); does not work - only calling clear at the same time cancels the scrolling process but then I cant scroll at all - even if I call the same function with a variable that decides whether or not to call clearInterval it never works. How can I reference the interval once I have started it ?
you must declare "aktiv" global. Just remove var
Struppi.
--
Javascript ist toll
© 1998-2006
Impressum, Software: Classic Forum