Показать сообщение отдельно
  #14 (permalink)  
Старый 03.10.2010, 11:47
Особый гость
Посмотреть профиль Найти все сообщения от monolithed
 
Регистрация: 02.04.2010
Сообщений: 4,260

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<style type="text/css">
body {background: #424A51;}
.block {position:absolute;top:20%;left: 40%;width: 200px;height: 50px;}
.block a {border: 1px solid #DDD;color: #FFF;display: block;text-align: center;text-decoration:none;width: 140px;height: 20px;}
.block img {border: 1px solid #DDD; width: 140px;height: 50px;}
</style>

<script type="text/javascript">
$(function(){
	$('.block').each(function(){
		$(this).find('img').hide();
		$(this).find('a').mouseover(function(){
			$(this).next('img').show();
		});
		$(document).click(function(e){
			(e.target.nodeName != $('.block img').get(0).tagName) && $(this).find('img').hide();
		});
	});
});
</script>

<div class="block">
	<a href="#" rel="">link</a>
	<img src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" alt="" />
</div>

Последний раз редактировалось monolithed, 03.10.2010 в 12:08.
Ответить с цитированием