Welcome to WebmasterWorld Guest from 54.147.134.218

Forum Moderators: open

Message Too Old, No Replies

Function continually firing, run sub-function only once

     
6:46 am on Sep 11, 2012 (gmt 0)

Full Member

5+ Year Member Top Contributors Of The Month

joined:Sept 30, 2009
posts:222
votes: 0


I have a function that fires as an object is moved:

function objectMoving(c){
if(x==y) doThis();
doThat();
};

Among other stuff, I would like to run doThis if my x==y, but only once per move.

Unfortunately objectMoving continually fires as the object is grabbed, even if the object is not moving. I do not have access to when the object is let go.

Is there a way to run doThis only on the last run of objectMoving?
3:11 am on Sept 13, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 0


Consider setting/reseting timeout each time, some time after last move, timeout will execute.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members