jQuery动画图标菜单导航 鼠标经过显示图标,图标在文字下方
XML/HTML Code
- <div class="navigation">
- <ul class="menu" id="menu">
- <li><span class="ipod"></span><a href="" class="first">Players</a></li>
- <li><span class="video_camera"></span><a href="">Cameras</a></li>
- <li><span class="television"></span><a href="">TVs</a></li>
- <li><span class="monitor"></span><a href="">Screens</a></li>
- <li><span class="print"></span><a href="" class="last">Printers</a></li>
- </ul>
- </div>
JavaScript Code
- <script type="text/javascript">
- $(function() {
- var d=1000;
- $('#menu span').each(function(){
- $(this).stop().animate({
- 'top':'-17px'
- },d+=250);
- });
- $('#menu > li').hover(
- function () {
- var $this = $(this);
- $('a',$this).addClass('hover');
- $('span',$this).stop().animate({'top':'40px'},300).css({'zIndex':'10'});
- },
- function () {
- var $this = $(this);
- $('a',$this).removeClass('hover');
- $('span',$this).stop().animate({'top':'-17px'},800).css({'zIndex':'-1'});
- }
- );
- });
- </script>
原文地址:http://www.freejs.net/article_daohangcaidan_395.html