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

Сообщение от Jopses
В чём проблема, понять не могу.
Начнём с работающего тестового примера...

<!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">
#box {
	position: fixed;
	top: 100px;
	left: 100px;
	width: 200px;
	min-height: 22px;
	border: 1px solid;
	display: none;
}
#box.on {
	display: block;
}
#box > div {
	margin-right: 22px;
}
#box > button {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 20px;
	height: 20px;
	padding: 0;
}
</style>
<script type="text/javascript">
$(document).ready(function (){
	$('.btn').click(function (){
		$('#box').addClass('on');
	});
	$('#box > button').click(function (){
		$('#box').removeClass('on');
	});
});
</script>
</head>
<body>
<a href='#' class='btn'>Test</a>
<div id='box'>
	<div>Text</div>
	<button>x</button>
</div>
</div>
</body>
</html>


Что именно не работает у тебя?
Ответить с цитированием