jQuery在悬停效果上设置凹凸动画

jQuery在悬停效果上设置凹凸动画,jquery,Jquery,我希望我悬停的图像在我不再悬停时向上移动,然后再向下移动。我能够使用CSS3实现这种效果,但由于并非所有浏览器都支持它,我希望它也能与jQuery一起使用。我为你做了一把小提琴: 以下是我的jQuery代码: $('.full-circle').mouseOver( function(){ $(this).stop().animate( {margin-top: '2'}, 500, 'swing' );//end anima

我希望我悬停的图像在我不再悬停时向上移动,然后再向下移动。我能够使用CSS3实现这种效果,但由于并非所有浏览器都支持它,我希望它也能与jQuery一起使用。我为你做了一把小提琴:

以下是我的jQuery代码:

$('.full-circle').mouseOver(
    function(){
        $(this).stop().animate(
            {margin-top: '2'}, 500, 'swing'   
        );//end animate
    },//end function
    function(){
        $(this).stop().animate(
            {margin-top: '15'}, 500, 'swing'
        );//end animate
    }//end function
);//end hover

我不确定你的问题是什么,但我修改了你的小提琴,通过jQuery来实现。我只需删除css转换,
:悬停
样式,将jQuery添加到小提琴中,将
动画
调用更改为使用
marginTop
而不是
边距顶部

$('.full-circle').hover(
    function(){
        $(this).stop().animate(
            {marginTop: '2'}, 500, 'linear'   
        );//end animate
     },//end function
    function(){
        $(this).stop().animate(
            {marginTop: '15'}, 500, 'linear'
        );//end animate
    }//end function
);//end hover

你的问题是什么?将颜色更改为红色:因此圆圈实际上是可见的,没有眯眼:D