0
在這裏寫我的第一塊代碼,以便忍受我的無能。我正在寫一個簡單的一頁Dreamcatcher應用程序,我希望文本在頁面加載後緩慢淡出。我認爲我正確地寫了一切,但是當我加載頁面時,文本不會消失。jquery fadeOut功能將不起作用
HTML:
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>DreamCatcher</title>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<p class="heading">Your Personal <span>Digital<span> Dreamcatcher</p>
<img src="http://www.eastofthesun.com/pi7/images/dreamcatcher21.gif" class="pic">
</body>
</html>
的JavaScript:
$(document).ready(function() {
$('.heading').fadeOut(2500);
});
CSS(可能無關):
@font-face{
font-family:"Beowulf";
src:url('C:/Users/JGSACKIN/Documents/Fonts/BEOWULF_.eot');
src:local('BEOWULF_'), url('C:/Users/JGSACKIN/Documents/Fonts/BEOWULF_.ttf') format(truetype), url('C:/Users/JGSACKIN/Documents/Fonts/BEOWULF_.svg') format(svg);
}
.heading{
font-family: Beowulf;
text-align: center;
font-size:50px;
-webkit-opacity:1;
opacity:1;
-webkit-transition: all 3s ease;
transition: all 3s ease;
}
.pic{
display:block;
margin-left:auto;
margin-right:auto;
width:25%;
height:25%;
}
我在哪裏搞亂這裏?
這裏是jQuery的? –
是「script.js」jQuery庫嗎?我想你沒有導入jQuery庫。 –
你的量程沒有正確關閉數字應該是數字 – Geoff