1. CSS
.menu {
margin: 100px 0 0;
padding: 0;
list-style: none;
}
.menu li {
padding: 0;
margin: 0 2px;
float: left;
position: relative;
text-align: center;
}
.menu a {
padding: 14px 10px;
display: block;
color: #000000;
width: 144px;
text-decoration: none;
font-size: 12px;
font-family: Tahoma;
text-transform: uppercase;
background: url(button.gif) no-repeat center;
}
.menu li em {
font-weight: normal;
background: url(hover.png) no-repeat;
width: 180px;
height: 45px;
position: absolute;
top: -85px;
left: -15px;
text-align: center;
padding: 20px 12px 10px;
font-style: normal;
display: none;
}
2. Подключение jQuery
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
3. JavaScript
<script type="text/javascript">
$(document).ready(function(){
$(".menu a").append("<em></em>");
$(".menu a").hover(function() {
$(this).find("em").stop(true, true).animate({opacity: "show", top: "-75"}, "slow");
var hoverText = $(this).attr("title");
$(this).find("em").text(hoverText);
}, function() {
$(this).find("em").stop(true, true).animate({opacity: "hide", top: "-85"}, "fast");
});
});
</script>
4. HTML
<ul class="menu">
<li>
<a href="http://jemand.ru" title="На главную страницу">Главная</a>
</li>
<li>
<a href="http://jemand.ru/menyu-so-vsplyvayushhimi-podskazkami-na-jquery/#commentarea" title="Оставить комментарий">Комментаторская</a>
</li>
<li>
<a href="http://vkontakte.ru/jemand_web/" title="Наша группа ВКонтакте">ВКонтакте</a>
</li>
</ul>
5. Изображения