Hello Lucas,
I changed your event to be not in the $w.onReady(), but as a separate event function and it seemed to work.
Here is a screenshot: