So, I was experimenting with the jQuery .animate()
function and decided to change the background color of a div
based on how many pixels the user scrolled. Surprisingly, it didn't work as expected. After switching to the .css()
function instead, everything was smooth sailing. Curious about why this happened? Check out the jsFiddle link below.
Find the explanation in this jsFiddle link: https://jsfiddle.net/ag_dhruv/cb2sypmu/