473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

stop onmouseover resume onmouseout

Hi:

What can I add to this script to make it stop scrolling onmouseover, and
resume onmouseout?

Thanks.
<script language="JavaScript">
function getObject( obj ) {
var strObj
if ( document.all ) {
strObj = document.all.item( obj );
} else if ( document.getElementById ) {
strObj = document.getElementById( obj );
}
return strObj;
}
var theTop = 20;
var theHeight = 100;
var theWidth = 150;
var theLeft = 650;
var toClip = 55;

function scrollNews( newsDiv, toMove ) {
theDiv = getObject( newsDiv.toString() );
if ( theDiv == null ) { return; }
if ( document.layers ) {
theDiv.clip.top = toMove;
theDiv.clip.bottom = toMove + toClip;
theDiv.top = theTop - toMove;
} else {
theDiv = theDiv.style;
theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " +
(toMove + toClip) + "px 0px)";
theDiv.top = theTop - toMove + 'px';
}
if ( ( theTop + theHeight - toMove ) < ( theTop - theHeight - 20 ) ) {
toMove = 0;
if ( document.layers ) {
theDiv.clip.top = theTop;
theDiv.clip.bottom = toClip;
theDiv.top = theTop
} else {
theDiv.clip = "rect(" + toMove + "px " + (theWidth + theLeft) + "px " +
(toMove + toClip) + "px 0px)";
theDiv.top = theTop + 'px';
}
}
toMove = (toMove + 1);
setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100);
}
</script>
Jul 23 '05 #1
1 5563
Greg A wrote:
Hi:

What can I add to this script to make it stop scrolling onmouseover, and
resume onmouseout?
Add an onmouseover and onmouseout event handler that will clear the
timeout and restart it.
setTimeout("scrollNews('" + newsDiv + "'," + toMove + ")", 100);


myTimer = setTimeout(..........)

onmouseover = clearTimeout(myTimer)
onmouseout = functionNameThatSetsTheTimerAgain();

Give it a try and post back

--
Randy
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim | last post by:
Hope someone in the big wide world can help... What I want to do is have an image slideshow which automatically scrolls through a series of images very fast, then pauses when you move your mouse...
1
by: christian9997 | last post by:
Hi I was trying to create a page where a SubMenu would appear when the user moved the mouse over an item of a Menu (= Table Cell <TD>). Unfortunately there seems to be a problem; the onMouseOver...
3
by: Rob Roberts | last post by:
I'm using .NET 2.0 and C# on a web site, and I'm trying to use the onmouseover and onmouseout events to do a rollover effect on an asp.net button. I've tried manually adding the events to the...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
3
by: oopaevah | last post by:
I have written some dom code to create a list of divs, each with it's own id. I want to set the onmouseover and onmouseout events to highlight the div when the mouse is over it. However I cannot...
2
by: Daz | last post by:
Hi everyone. I think my problem is a simple one, but I am completely baffled as to how to pull it off. I have a piece of code like so... document.write( "<img id=\"slideshow_toggle\"...
1
by: mark4asp | last post by:
<form runat="server"automatically adds <divtag to code contained within. Is there a way to stop that? Mixing block-level elements with inline-level elements messes up the HTML becasuse that is...
4
by: bgold12 | last post by:
Hey, I have kind of a weird problem. I have a span that I'm intentionally overflowing a table cell (<td>), so that it stretches over the table cells to the right of the parent table cell. I want...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.