Trying to animate background color on page load but it only works when I actually click the element. I am using the colors plugin.
$(window).load(function () {
$(".hilite").toggle(function() {
$(this).animate({ backgroundColor: "yellow" }, 1000);
},function() {
$(this).animate({ backgroundColor: "#FFF2A8" }, 500);
});
})
<span class="hilite">THIS should change background COLOR</span>
As far as I understand, you are trying to do this:
or this: