jQuery Animate - border color and width

前端 未结 5 1790
忘掉有多难
忘掉有多难 2020-12-16 20:16

I cannot seem to get this jQuery animation working for applying a border to an image on mouseenter:

5条回答
  •  悲&欢浪女
    2020-12-16 20:49

    Fixed code:

    http://jsfiddle.net/9qwmX/491/

    $('div img').mouseenter(function () {
        $(this).css({
            outline: "0px solid transparent"
        }).animate({
            outlineWidth: '4px',
             outlineColor: '#f37736'
        }, 500);
    }).mouseleave(function () {
        $(this).animate({
             outlineWidth: '0px',
             outlineColor: '#037736'
        }, 500);
    });
    

提交回复
热议问题