I want to change the CSS of an input field over a time of 1800 milisec. It works, but there is no smooth transition. Do I have to put a fadeIn/Out somewhere? What am I missing here:
$(".div-input").blur(function () {
$('.div-input').removeClass("div-input", 1800).addClass('div-input-second');
});
You can use .animate() to change the CSS values yourself, but there isn't a way to fade between classes like that.
Looks like invalid parameters for one, and also you can use contextual this for the selector in your function for blur.
removeClass() takes either a class name or a function. Not sure what the 1800 in your parameter list. If you want animation look into animate.
Try this...
$(".div-input").blur(function () {
$(this).removeClass("div-input").addClass('div-input-second');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With