I would like to animate an input control border where it changes colour twice using a smooth animation.
What do I need to add to the code below to add another animation to make it change colour again (to say #FF0?).
When I add a second animiation to the code below, jQuery appears to ‘reset’ the border colour rather than smoothly animating.
$(‘#searchinput’).click(function() {
$(‘#searchinput’).animate({borderColor: ‘#36C’}, 400)
});
There is some bug in jQuery UI library. If you animate
borderColor, it doesn’t properly detect old value of border color. However, if you useborderLeftColor,borderTopColoretc., it works correctly. I suggest you to use this code to fix your issue:Live example