|
-
Mar 27th, 2003, 10:57 AM
#1
Thread Starter
Evil Genius
Doevents in JS?!?!?!?!
Hi everyone! I've got this code which is called to scroll my div tag.
Code:
function ScrollDIVDown()
{
blnKeepScrolling = true;
while (blnKeepScrolling = true)
{
document.getElementById('divToScroll').scrollTop =
document.getElementById('divToScroll').scrollTop + intScrollIncrement;
}
}
Now this one's called when the user hovers their mouse over an image, when the mouseout event of the same image occurs, I'm trying to alter the variable & therefore exit the loop - but the loop keeps on continuing and the mouseout event never gets fired! Is there a better way to do this please, or is there a JS doevents equivalent?
Code:
<IMG SRC="images/ScrollArrow_Up.jpg" onmouseover="Javascript: ScrollDIVDown()"
onmouseout="javascript: blnKeepScrolling=false;">
Thanks!!
-
Mar 27th, 2003, 12:01 PM
#2
change
while (blnKeepScrolling = true)
to
while (blnKeepScrolling == true)
I assume blnKeepScrolling is global
-
Mar 28th, 2003, 03:16 AM
#3
Thread Starter
Evil Genius
Drat missed that one - thanks for spotting that! unfortunatley though, this doesn't make it work though....
-
Mar 28th, 2003, 04:24 AM
#4
Then I assume the onMouseout won't get fired until the onmouseOver function has finished, and this won't finish because it's in an infinite loop.
Within the ScrollDIVDown function's loop is there a way to check if the mouse is over the image and if not exit loop.
-
Mar 28th, 2003, 04:27 AM
#5
Thread Starter
Evil Genius
Guess I could do an event check function, yep will check this out thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|