Показать сообщение отдельно
  #9 (permalink)  
Старый 23.11.2011, 10:53
Аватар для ksa
ksa ksa вне форума
CacheVar
Отправить личное сообщение для ksa Посмотреть профиль Найти все сообщения от ksa
 
Регистрация: 19.08.2010
Сообщений: 14,134

Сообщение от dimidrol
Но я не понимаю что мне использовать ...
Даю намёк...

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<!--
<link rel="stylesheet" type="text/css" href="tmp.css" />
-->
<style type="text/css">
#playing td {
	width: 30px;
	height: 30px;
}
.player0 {
	background: url('http://javascript.ru/forum/images/smilies/blink.gif') no-repeat center;
}
.player1 {
	background: url('http://javascript.ru/forum/images/smilies/laugh.gif') no-repeat center;
}
</style>
<script type="text/javascript">
player=0;
$(document).ready(function (){
	$('#playing td').click(function (){
		if (this.className!='') {
			return false;
		};
		this.className='player'+player;
		player=(player+1)%2;
	});
});
</script>
</head>
<body>
<table border='1'>
<tbody id='playing'>
<tr>
	<td></td><td></td><td></td>
</tr>
<tr>
	<td></td><td></td><td></td>
</tr>
<tr>
	<td></td><td></td><td></td>
</tr>
</tbody>
</table>
</body>
</html>
Ответить с цитированием