Spin animation on hover then stop when not hovering

I uploaded a png of words that make a circle and I’ve been trying to make it rotate when hovering with a mouse and then stop rotating when not hovering. I’ve tried the code widget and followed the steps on this readymag link

readymag code widget

This seems to be the way to go except I’m not sure if the code I’ve been using is correct. Let me know if anyone has questions, I hope this makes sense! Thank you!