Cant click() frame without selecting it first?


#1

Bit of a strange problem. I’ve created a mockup using marvelapp, and I’ve implemented it into Hype because it’s scales much better that way.

There are a lot of photos that load when you click the play button, so it takes about 20 seconds to load completely. I’m trying to make it load on page launch without the user clicking the play button.

I’ve found that if I select the frame with developer tools and enter -

$(".PlayButton__button___3P8ZC").click(); 

Into the console, it starts loading everything. But if I don’t select the frame first it says:

VM624:1 Uncaught TypeError: Cannot read property 'click' of null
at <anonymous>:1:33

Here’s an example


(Jonathan Deutsch) #2

I’m seeing in the developer console: Error in untitledFunction: ReferenceError: Can't find variable: $

My guess would be that jquery has not loaded, or not loaded yet. Note that modern browsers will use $ as a shortcut to querySelector in the console, which can be deceiving when dealing with jquery load order issues!