下面是我使用2個引號淡入淡出的完整HTML代碼。它在jfiddle中工作,但不在我的網頁上。誰能告訴我什麼是錯的?使用CSS和jQuery淡入淡出
這裏的jfiddle:here
和這裏的HTML代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style>
.quotes {display: none;}
</style>
</head>
<body>
<h2 class="quotes">first quote</h2>
<h2 class="quotes">second quote</h2>
<script>
(function() {
var quotes = $(".quotes");
var quoteIndex = -1;
function showNextQuote() {
++quoteIndex;
quotes.eq(quoteIndex % quotes.length)
.fadeIn(2000)
.delay(2000)
.fadeOut(2000, showNextQuote);
}
showNextQuote();
})();
</script>
</body>
</html>
你能否以更具體的方式提出你的問題。你有什麼嘗試。你認爲這個錯誤在哪裏?你能找到更具體的方法來問我的程序有什麼問題嗎? – sylvanaar