onmousemove
I recently created my companies intranet. They decided to put a pc in the cafeteria for all the workers who don't have computers. They asked me to create a slideshow that rolled through the site and when the user moved the mouse it would launch the site. so here is what i did
<script language="javascript">
function relocate()
{
top.location.href="http://iww.blah.com/a";
return;
}
function countDown()
{
setTimeout('scrolling()', 3000);
}
function scrolling()
{
for(i=0; i<2000; i++){window.scroll(0,(1+i))}
}
</script>
<META HTTP-EQUIV="refresh" CONTENT="10;URL= nextpage.html">
<body onload="countDown()" onmousemove="relocate()">
However, i could not get onmousemove to work and eventually had to end up using onmousedown (so they have to click the mouse to launch the site). onmousemove would repeatedly try and load the site over and over without actually doing it. Sorry for the long nature of this, but I was wondering if anyone knew what I was doing wrong with onmousemove?
p.s. IE 5 is the browser used on the computer.
Arielladog posted this at 22:36 — 9th December 1999.
They have: 122 posts
Joined: Jun 1999
I don't know much abou Javascript, at all, but I am trying to learn. I have never heard of the onmousemove command. It probably is one, but maybe you could us the onunload command since the page will automatically change to a new one in 10 seconds.
Moderate at JavaScriptCity Forums
Precisivee posted this at 04:34 — 10th December 1999.
They have: 10 posts
Joined: May 1999
RC,
I never heard of onmousemove before. Well, to have another javascript that works almost the same is mouseover. Not mousemove.
That's all. Thank you.
Regards,
Andrew Chen
Precisive Interactive
http://www.avention.com/
Jack Michaelson posted this at 08:39 — 10th December 1999.
He has: 1,733 posts
Joined: Dec 1999
I've never heard of the OnMouseMove either, but there must be something like that.
see--> http://www.schaffhausen.de/
As you can see the picture moves when you move the mouse. If that is an OnMouseMove you can't find out as the JS is an external file. But it sure looks like one.
------------------
Jack Michaelson
[email protected]
! Click here for my profile !
I did some research and now I know the OnMousMove exist.
It is a standard eventhandler in MS Visual Interdev 6.0.
I do not understand why it would't work on your page, RC.
But I also do not understand why you use the return after:
top.location.href="http://iww.blah.com/a";
I think the return is not necessary for the script, but I'm not sure.
[This message has been edited by Jack Michaelson (edited 10 December 1999).]
Shakespeare: onclick || !(onclick)
RC posted this at 12:59 — 10th December 1999.
They have: 89 posts
Joined: Sep 1999
Thanks to all for your replies.
OK. I had already tried onmouseover and it worked great, but it worked too great. I put onmouseover="relocate()" in body and it worked just fine. See the site that the relocate function jumps to has a countdown on it to restart the slideshow should there be inactivity. I.E. if a page is left up for 15 minutes without loading another page it launches the slideshow again. NOW....if the user left the mouse OVER the screen, it would automatically shoot back to the countdown page thus eliminating the slideshow altogether and becoming useless.
Argh.
Anyway, so I wanted to use mousemove to launch the countdown site. I have tried it with and without return also. So, thanks for your assistance, but I guess I'm just going to have to go with onmousedown because that seems to work.
IanD posted this at 06:00 — 11th December 1999.
They have: 222 posts
Joined: Sep 1999
This might be kinda stupid, but wouldn't it just be easier to convert the slide show into a screen saver? That would end when the mouse is moved, and would reactivate after X idle minutes. I'm sure theres some utilitie to convert a power point (or whatever) presentation to a screen saver...
------------------
Ian
http://members.antionline.com/cst/
Fighting for a Lost Cause.net
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.