2015-05-15 36 views
3

爲什麼它不會淡出?爲什麼它不淡出?

<!DOCTYPE html> 
<html> 
    <head> 
    <link rel="stylesheet" type="text/css" href="stylesheet.css"/> 
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js"></script> 
    <script type="text/javascript" src="script.js"></script> 
    </head> 
    <body> 
     <p>asdasds</p> 
    </body> 
</html> 

我的script.js是一個外部文件

$(document).ready(function() { 
    $('p').fadeOut(500); 
}); 
+0

哇有趣個個都是精品中的代碼 –

+0

https://jsfiddle.net/somnath_k/no7jydaw/代碼沒有錯..你有什麼錯誤嗎? –

+1

網址http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js不存在。 – panther

回答

4

錯誤404當我在你的腳本標籤打開新的標籤頁下面的代碼

http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js

使用。

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script> 

或按kmsdev建議添加最新版本

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 
+0

我應該使用什麼庫? –

+4

或使用新的2.x版本...'https:// ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js' – kosmos

+0

它的工作原理!謝謝 。 。 。 –