Keyframe background change on click?

So i’ve gone through the keyframes and for the most part understood those, however im wanting to do a background color transition on my “Quote Machine” :

right now im doing a simple background change on click:

$("body").css("background-color", newcolor);

Where newcolor is just pulling randomly from an array of color hex values.

Since I can’t really just set the CSS keyframes to constantly change, how would I accomplish this on click? I want it to be a sort of slowish transition so it’s not an instant color change.

You can consider using the jQuery Colour plugin, which allows you to animate background colour as follows:

        backgroundColor: "salmon"

Good luck! :slight_smile: