setTimeout(target.mousedown, 200)
doesn't seem to work. I can do setTimeout("target.mousedown()", 200)
, but this feels dirty.
What's the right way to do this?
setTimeout(target.mousedown, 200)
doesn't seem to work. I can do setTimeout("target.mousedown()", 200)
, but this feels dirty.
What's the right way to do this?
You might like this better:
setTimeout(function() { target.mousedown(); }, 200);
You haven't given us too much of your code but this definitely works:
var target = {
mousedown: function() {
alert('foo');
}
};
setTimeout(target.mousedown, 200);