悬停时 jQuery 动画边框颜色?

2024-05-09

Using a 颜色插件 http://plugins.jquery.com/project/color悬停时设置背景颜色动画。

$(function() {
    $('.listing-2 li a').mouseover(function() {
        $(this).animate({
            backgroundColor: "#0e7796"
        }, 'fast');
    });
    $('.listing-2 li a').mouseout(function() {
        $(this).animate({
            backgroundColor: "#d6f2c5"
        }, 'fast');
    });
});

我怎样才能对边框颜色做同样的事情?


在谷歌上找到的

    $('.listing-2 li a').mouseover(function() {
    $(this).animate({ borderTopColor: "#0e7796" }, 'fast');
});
$('.listing-2 li a').mouseout(function() {
    $(this).animate({ borderTopColor: "#fff" }, 'fast');
});

它必须是“borderTopColor”(或左、右、下)而不是“borderColor”。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

悬停时 jQuery 动画边框颜色? 的相关文章

随机推荐