内部jQueryを使用してランダムなhtmlページを作成しています。jQueryで3つの段落のうち2つを非表示にし、これを5秒間実行しようとしていますが、htmlファイルをロードすると、すべての段落がすぐに表示されます. 誰でも助けることができますか?
<html>
<head>
<script src="jquery-1.9.1.js"></script>
</head>
<body>
<script>
var $ = jQuery;
$("p").each(function (idx) {
if(idx >= 1) {
$(this).hide(500);
}
});
</script>
<p>This is the first paragraph</p>
<p>This is the second paragraph</p>
<p>This is the third paragraph</p>
</body>
</html>