我在做一個危險的遊戲。當我點擊一個div時,我想對它做一些效果。但是,我甚至無法得到一個簡單的.hide工作。有任何想法嗎?。隱藏不起作用
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jeopardy</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/customStyles.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/flip.js"></script>
</head>
<body>
<div class ="container">
<div class="row">
<div class="prizeAmount">
<div class="span2">
<h3 id="test">100</h3>
</div>
<div class="span2">
<h3>100</h3>
</div>
<div class="span2">
<h3>100</h3>
</div>
<div class="span2">
<h3>100</h3>
</div>
<div class="span2">
<h3>100</h3>
</div>
<div class="span2">
<h3>100</h3>
</div>
</div>
</div>
</div><!--close container-->
</body>
</html>
的JavaScript
$(function() {
$('#span2').click(function() {
$(this).hide(400);
/*$('#span2').hide(400); <--tried this also */
});
});
我用jQuery來之前在網站上的動畫導航。我錯過了明顯的東西?
,嘗試'.span2'代替 – Jack
參考到[jQuery ID Selector](http://api.jquery.com/id-selector/)和[jQuery類選擇器](http://api.jquery.com/class-selector/)文檔 – PhearOfRayne