jQuery Animate not working on background-color property

0 votes
I was playing around with the jQuery .animate() function, and ended up trying to change the background-color of one of the divs depending on the number of pixels scrolled by the user. To my surprise, it did not work. I tried using the .css() function instead, and it worked well. Please refer the jsFiddle link at the bottom.

Could somebody explain to me why this is happening?
Jun 16, 2022 in JQuery by gaurav
• 23,260 points
511 views

1 answer to this question.

0 votes

The background color animate can be performed with the help of the animate() function or css() function. The background color animate is used to set the background color of the selected elements.

Image result for jQuery Animate not working on background-color property

answered Jun 16, 2022 by rajatha
• 7,640 points

Related Questions In JQuery

0 votes
1 answer

Error:jQuery scrollTop not working in Chrome but working in Firefox

Hello @kartik, If your CSS html element has the following overflow markup, scrollTop will ...READ MORE

answered May 29, 2020 in JQuery by Niroj
• 82,880 points
14,069 views
0 votes
1 answer

jquery timepicker cdnjs.cloudflare does not working

jQuery Timepicker can parse the most used ...READ MORE

answered Jun 1, 2022 in JQuery by Edureka
• 13,670 points
1,118 views
0 votes
1 answer

jQuery - remove background-color when an element is visible

$("#menu a"). css("background-color", ""); Setting the background-color to "" ...READ MORE

answered Jun 7, 2022 in JQuery by Edureka
• 13,670 points
2,457 views
0 votes
1 answer

jQuery Validation plugin. Two custom rules not working

validation plugin works according to the name attribute and ...READ MORE

answered Jun 20, 2022 in JQuery by rajatha
• 7,640 points
1,110 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,510 points
995 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
14,260 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
22,442 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,880 points
2,970 views
0 votes
1 answer

jQuery on page load event not working

You should be passing .on("load") on the window instead ...READ MORE

answered Jun 20, 2022 in JQuery by rajatha
• 7,640 points
1,416 views
0 votes
1 answer

jQuery slideDown() animation not working

Your p element is already displayed when you enter ...READ MORE

answered Jun 16, 2022 in JQuery by rajatha
• 7,640 points
1,105 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP