I have a "circular-shaped" div with class = "complete-button" (height/width =27px, border radius = 12px). I'd like to change the background color of this div on-click, starting from the center and expanding outwards with a gentle easing.
What's the most efficient approach for doing this? I've seen some posts accomplishing this using css on-hover (using before and after selectors), but I'm not yet savvy enough to convert that idea to a jQuery on-click. Any help would be greatly appreciated!
Use this CSS:
Then toggle the
selected
class on click.Snippet
You define your transition effects in css, and use js to perform simple class toggle.
Play with it on codepen
html:
css:
JS: