2012-05-31 79 views

回答

1

我想你会想使用一些jQuery的像

.mouseenter() http://api.jquery.com/mouseenter/

.mouseleave() http://api.jquery.com/mouseleave/

.slideUp() http://api.jquery.com/slideUp/

.slideDown() http://api.jquery.com/slideDown/

因此,基本上当鼠标进入时,您会向上滑动新图像,并且当鼠标离开时,会向下滑动旧图像。

编辑:

查看源,这里是他们做了什么。

$('footer .social li').hover(function() { 
     $(this).find('a').clone().addClass('hover').appendTo($(this)); 
     $(this).find('a:first-child').stop().animate({ marginTop: -25 }, 150); 
    }, function() { 
     $(this).find('a:first-child').stop().animate({ marginTop: 0, opacity: 0.99 }, 150); 
     setTimeout(function() { $(this).find('a.hover').remove(); }, 150); 
    }); 
+0

hrmmm好的,我会试试这个。现在设置html。 – bryanlewis

+0

我试图让这个脚本在这里工作。不确定为什么它不是。我已经瞄准了正确的元素。 http://www.omahaimage.com/ – bryanlewis

+0

你有没有在你的CSS? 'footer .social a.facebook {background-position:-26px 0; } 页脚.social a.facebook.hover {background-color:#3B5998; }' –