Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / February 2005



Tip: Looking for answers? Try searching our database.

Mouse Over & Refresh of images ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mel - 28 Feb 2005 16:34 GMT
i have a page that refreshes every minute. i would like to cancel the
refresh when the mouse is over my image and refresh the page when the mouse
moves out of the image.

is this possible ? if so, how

thanks for your help
kaeli - 28 Feb 2005 18:42 GMT
> i have a page that refreshes every minute. i would like to cancel the
> refresh when the mouse is over my image and refresh the page when the mouse
> moves out of the image.

I assume you use a timeout?
Put it in a function if you haven't.
Just cancel the timeout onmouseover and start it back up onmouseout.

Like:
function myTimer()
  {
  // code to start timer
  }
function stopMyTimer()
  {
  // cancel your timer
  }

<img onmouseover="stopMyTimer()" onmouseout="myTimer()" ...>

Signature

--
~kaeli~
Any sufficiently advanced technology is indistinguishable
from magic.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Mel - 28 Feb 2005 19:44 GMT
sorry for being a JS newbeee
i was using HTTP_EQUIV statement for that.

if its not too much to ask for, could you help me out with a little code
example here ?

thanks anyway for your pointer

> > i have a page that refreshes every minute. i would like to cancel the
> > refresh when the mouse is over my image and refresh the page when the mouse
[quoted text clipped - 15 lines]
>
> <img onmouseover="stopMyTimer()" onmouseout="myTimer()" ...>
Randy Webb - 28 Feb 2005 23:35 GMT
> sorry for being a JS newbeee
> i was using HTTP_EQUIV statement for that.

You know you can explicitly disable Meta Refresh in IE6?

> if its not too much to ask for, could you help me out with a little code
> example here ?

var myVar;

function myTimer()
   {
   myVar = setTimeout('changeURL()',1000)
   }
function stopMyTimer()
   {
   clearTimeout(myVar)
   }
function reloadPage(){
document.location.reload(true);
}

<img onmouseover="stopMyTimer()" onmouseout="myTimer()" ...>

> thanks anyway for your pointer

More pointers in my signature.

Signature

Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.