HTML格動畫不能正常工作的jQuery
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle1.css">
<title>hd images</title>
</head>
<body>
<div id="top1">
<div class="inside1">
<div class="nested_inside1"> MY HAPPY PLACES </div>
</div>
<div class="inside2">
<div class="nested_inside2"> CLUMSSY BEACHES
</div>
</div>
<div class="inside3">
<div class="nested_inside3"> REGULAR APPLES </div>
</div>
<div class="inside4">
<div class="nested_inside4"> LUSTY BRUSHES </div>
</div>
<div class="inside5">
<div class="nested_inside5"> ECSTATIC DIMENSIONS </div>
</div>
<div class="inside6">
<div class="nested_inside6"> CURLY HILLS </div>
</div>
<div class="inside7">
<div class="nested_inside7"> SHINY WATER </div>
</div>
<div class="inside8">
<div class="nested_inside8"> COOL BOATS </div>
</div>
<div class="inside9">
<div class="nested_inside9"> CRUNCHY CLUSHTERS </div>
</div>
<script type="text/javascript" src="myscript2.js"></script>
</body>
</html>
的JavaScript
$(document).ready(function() {
$("#top1").on("hover", ".nested_inside", function() {
$(this).animate({
"top": "-10px"
});
});
});
其實我刪除它,並把它改爲nested_inside但它仍然不工作 –
我已經包含鏈接 仍然無效 –
更新了我的答案,這應該適合您。請點擊upvote,並檢查我的答案,如果它解決了您的問題;-) –