how to mimic developer console style intervention event

I am trying the trigger resize event of a canvas. However, I am not very good at javascript. but I realize that, If I toggle width check-box in computed section of developer console, canvas slowly resize itself. Now I want to know how to mimic that event.

enter image description here

I tried ::after ::before tags in css but it didn’t work.