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

Сообщение от Icepeek
Как сделать, чтобы по щелчку на блоке <div class="descriptionButton"> выводилось только нужное описание <div class="descriptionView">, а не все сразу?
Как вариант...

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<!--
<link rel="stylesheet" type="text/css" href="tmp.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
-->
<style type="text/css">
.descriptionView {
	display: none;
}
</style>
<script type="text/javascript">
$(function (){
	$('.descriptionButton').click(function (){
		$(this).parents('.wigetVideo').next('.descriptionView').toggle();
	});
});
</script>
</head>
<body>
<div class="videoContainer">
		<div class="previewImg">
			<img src="mov/preview/gp.jpg" alt="Garry_Potter" />
		</div>
		<div class="wigetVideo">
			<div class="titleView">
				Гарри Поттер и Дары смерти (часть 1)
			</div>
			<div class="timeView">
			1:42:00
			</div>
			<div class="videoButton">
				<div class="descriptionButton descriptionColor">
					<img src="img/comment.png" alt="comment_button" width="30px" class="commentPic" />
				</div>
				<div class="playButton playColor">
					<img src="img/play.png" alt="play_button" width="30px" />
				</div>
				<div class="profileButton profileColor">
					<img src="img/profile.png" alt="profile_button" width="30px" />
				</div>
			</div>
		</div>	
			<div class="descriptionView">
				<p>Гарри, Рон и Гермиона отправляются в рискованное путешествие, 
				ведь им предстоит выполнить важную миссию: 
				найти и уничтожить тайные источники бессмертия и могущества Волан-де-Морта — Крестражи. 
				</p>
			</div>
	</div>
</body>
</html>
Ответить с цитированием