我下载了一个 Html5 开源记忆游戏代码我正在尝试添加一些功能,但是按钮操作和 removeClass()、addClass() ... 方法不起作用所以我记得在脚本标签中添加 jquery.js但在那之后,游戏又没有工作了。我认为这是prototype.s2.min.js 的问题。这是代码:
html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>scripty2 Memory!</title>
<link href="memory.css" media="screen" rel="Stylesheet" type="text/css" />
</head>
<body>
<div id="field">
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div class="card"><img src="back.png"/></div>
<div id="score">0</div>
<div id="tries">0</div>
</div>
<!--<div id="controls">
<a href="#" onclick="shuffle()">shuffle cards</a><br/>
<a href="#" onclick="shuffle(3)">shuffle cards (slowly)</a>
</div>-->
<script type="text/javascript" src="prototype.s2.min.js"></script>
<script type="text/javascript" src="memory.js"></script>
<script src="js/jquery-1.6.min.js"></script> // i added this
</body>
</html>
我没有更改 js 和 css 代码。任何想法请提前谢谢你