I need the opposite of this. What I want to happen is the page loads, div_a hides after 3 seconds and then div_b hides after 3 more seconds. If I set both timeouts to 3 seconds, they happen together as if the clock starts from page load, not when the last event finished like other scripting, eg Python. I have to wait 3 seconds for the first and 6 seconds for the second per the last line of code.
Code:
var ta = 3000;
var tb = 3000;
var hideDivA = function() {
$('#div_a').css({"display":"none"});
}
var hideDivB = function() {
$('#div_b').css({"display":"none"});
}
setTimeout(hideDivA, ta);<!--wait 3 seconds-->
setTimeout(hideDivB, ta+tb);<!--wait 3 more-->
Comment