为什么它不淡出?

时间:2015-05-15 12:01:00

标签: jquery

为什么它不淡出?

<!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);
});

1 个答案:

答案 0 :(得分: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>