View Single Post
  #3 (permalink)  
Old June 2nd, 2008, 03:07 PM
philip_cole philip_cole is offline
Friend of Wrox
Points: 894, Level: 11
Points: 894, Level: 11 Points: 894, Level: 11 Points: 894, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Joe is right with clearTimeout. The other way is to use some simple logic within changeImage to decide whether to actually change it or not. Something like

var doChange = true;

function stopChangeImage() {
  doChange = false;
}

function changeImage() {
  if(doChange) {
    // ... code to perform change ...
  }
}

Reply With Quote