DIV CSS 佈局教程網

jquery在線五子棋代碼
編輯:JQuery常見問題     
在線五子棋試玩地址:http:///game/12/



以下是完整代碼,保存到html文件打開也可以玩:
<!DOCTYPE html>
<html>
<head>
<title>在線五子棋-</title><base target="_blank" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="http:///game/12/main.css" />
<script type="text/javascript" src="http:///keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http:///game/12/locale.js"></script>
<script type="text/javascript" src="http:///game/12/gomoku.js"></script>
<script type="text/javascript">
var turn = 1, role = ['AI', 'human'];
$(function () {
var gomoku = new Gomoku();
gomoku.init(role[turn]);
//turn = turn === 0 ? 1 : 0;
$('#restart').click(function () {
gomoku.restart.call(gomoku, role[turn]);
// turn = turn === 0 ? 1 : 0;
});
$('#regret').click(function () {
gomoku.regret.call(gomoku);
});
});
</script>
</head>
<body>
<div id="toolbar">
<div class="top">
<span class="switch-lang">
<a href="javascript:;" id="zh-cn">簡體中文</a>
<a href="javascript:;" id="en">English</a>
</span>
<span class="copy">
&copy;<a href="http:///"></a>
</span>
</div>
You: Black, AI: White, Round: <span id="round">0</span>
<button id="restart">Restart</button>
<button id="regret">Regret</button>
</div>
<div id="output"></div>
<div id="main" ></div>
<div style="width:736px;margin:10px auto;clear:both;position:absolute;top:560px;left:0px;right:0px;"><a href="http:///game/">更多游戲</a></div>
</body>
</html>

更多游戲
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved