相关疑难解决方法(0)

jQuery动画backgroundColor

我试图在鼠标悬停时使用jQuery为backgroundColor中的更改设置动画.

我已经检查了一些例子,我似乎做对了,它适用于其他属性,如fontSize,但我使用backgroundColor和"无效属性"js错误.我正在使用的元素是div.

$(".usercontent").mouseover(function() {
    $(this).animate({ backgroundColor: "olive" }, "slow");
});
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

javascript jquery colors jquery-animate

324
推荐指数
11
解决办法
47万
查看次数

无法使用jQuery为边框颜色设置动画

我有这张桌子:

<table id="social" border="5">
    <tr>
        <td>
            <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fyannbane.blogspot.com%2F&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=177127339057410" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
        </td>

        <td>
            <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://yannbane.blogspot.com/" data-via="Yannbane">Tweet</a>
        </td>

        <td>
            <g:plusone></g:plusone>
        </td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

我想用jquery为它的边界设置动画,如下所示:

$("#social").animate({"borderTopColor": "#f00", "borderBottomColor": "#fff"}, 800);
Run Code Online (Sandbox Code Playgroud)

但是,它不起作用!什么都没发生,即使没有显示错误......

我也试过这个:

$("#social").animate({"border-top-tolor": "#f00", "border-bottom-color": "#fff"}, 800);
Run Code Online (Sandbox Code Playgroud)

但结果相同......你是怎么做到的?

html javascript jquery animation html-table

2
推荐指数
1
解决办法
2481
查看次数