Possible Duplicate:
Jquery delay execution of script
I am writing a small script that, when the page loads, assigns a CSS subclass to three elements. 800ms later, I want it to remove that subclass.
I thought this code might do it:
<script type="text/javascript">
$(document).ready(function () {
$("#rowone.one").addClass("pageLoad");
$("#rowtwo.three").addClass("pageLoad");
$("#rowthree.two").addClass("pageLoad");
.delay(800);
$("#rowone.one").removeClass("pageLoad");
$("#rowtwo.three").removeClass("pageLoad");
$("#rowthree.two").removeClass("pageLoad");
})
</script>
Sadly it doesn’t, any help would be much appreciated. Thanks in advance.
You can use
setTimeout()function: