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?