You need to call .dequeue()in the callback .queue(), otherwise the following items in the queue will never be executed.
$(document).ready(function() {
$(".websites-container").delay(1000).queue(function() {
$(this).addClass("active").dequeue();
}).delay(2000).queue(function() {
$(this).addClass("gone");
});
});
.active {font-weight: bold}
.gone {color:red}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="websites-container">abc</div>
Run codeHide result(This was almost resolved by @adeneo , with the exception of being placed in the dequeue callback.)
source
share