<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#a").hide(1000);
$("#b").hide(1000);
$("#c").hide(1000);
});
</script>
</head>
<body>
<p id="a">Paragraph 1</p>
<p id="b">Paragraph 2</p>
<p id="c">Paragraph 3</p>
</body>
</html>
Javascript is single threaded, so I think functions are executed one by one. But in the sample above, it seems the three paragraphs start the hide
animation simultaneously and ended at the same time, as if there are three threads each running one distinct animation. why are the animations not run one by one ?