I have a 'yellow fade technique' function running which fades the border of a <div> so that the user is visually alerted to an as-you-type response on the page. He types in a form field and a preview div is updated with the content and highlighted using the yellow fade on the border only.
Because the border fade is called everytime onKeyUp this queues up the requests to run the fade so a fast typist sees a whole load of these fades in sucession even after he stops typing.
I want to know how to stop a particular function from running if it is asked to run again. This should result in the function reseting each time it is called so that in this case the border stays yellow until after the last onKeyUp and just fades away once.