Reputation: 13206
Is it possible to setTimeout to multiple objects so their events occur in exactly same timespan?
This is what I have so far, but it is returning me a syntax error:
setTimeout(function() {
$('#post_confirm').fadeOut('slow');},
$('#chat').height($chatHeight_user);},
1000);
Upvotes: 0
Views: 76
Reputation: 1889
Try this:
setTimeout(function() {
$('#post_confirm').fadeOut('slow');
$('#chat').height($chatHeight_user);
},1000);
Upvotes: 1
Reputation: 15356
You have a syntax error, use:
setTimeout(function() {
$('#post_confirm').fadeOut('slow'); // lose the }, here
$('#chat').height($chatHeight_user);
}, 1000);
setTimeout()
works like this:
setTimeout(callback,time)
So you can replace callback
with a single anonymous function that has all the other code in it.
Upvotes: 3