jQuery动画边框 [英] jQuery animate border

查看:254
本文介绍了jQuery动画边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为输入的边框设置动画,但是无论我如何放置边框,它似乎都没有动画.

我当前的代码:

$(this).animate({border : '1px solid #f00'}, 'slow', 'linear');

解决方案

您必须设置边框颜色和样式CSS属性 在完整的jquery中:

$(this).css({borderColor:"#f00",borderStyle:"solid"}).animate({borderWidth : '3px'}, 'slow', 'linear');

您需要插件来为jquery中的边框颜色设置动画,请检查以下内容: http://www.bitstorm.org/jquery/color-animation/

然后..

$(this).animate({borderColor: '#f00'});

也许可以帮助某人...

Hi I am trying to animate the border of an input but no matter how I put the border it just doesn't seem to animate.

My current code:

$(this).animate({border : '1px solid #f00'}, 'slow', 'linear');

解决方案

You have to set the border color and style css properties In full jquery :

$(this).css({borderColor:"#f00",borderStyle:"solid"}).animate({borderWidth : '3px'}, 'slow', 'linear');

You need plug-in for animate border color in jquery, check this : http://www.bitstorm.org/jquery/color-animation/

Then..

$(this).animate({borderColor: '#f00'});

Maybe that's could help someone...

这篇关于jQuery动画边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆