Javascript is not active before the content loads

Helly guys

I wonder one thing: I have an off canvas element with an attribute aria-hidden=“false”, which loads the element “open” and a the toggle “closes” the element on click.

This js works only after the content, at least the looper in a lower div is loaded. Is there a way how to make the script listening before the content of the page is loads?

The site in question is in the secure message, NDA… sh…

There is no other custom javascript for the page nor global there.

EDIT: ok, I figured out, that the caching plugin is the troublemaker. What JS do I need to exclude from caching?
EDIT 2: According to the plugin author, who checked the settings, the caching plugin is not the cause. Duh. The delay is still present even the caching is off on his side.

Hello Ondrej,

Thanks for writing in! By default, the CSS is added at the head of the page while the Javascripts are added at the bottom of the HTMLpage. Be advised that all page resources including the Javascript must be loaded first before it can be applied to the page elements. There should be a slight delay specially if the page size is slightly bigger file size.

  • See the secure note below

Best Regards.

Hello. Yeah. It’s almost gone. I don’t understand. The point is, the client is clicking the “close” button and it does not work right of the bat, but until the page is rendered. It’s fast here. It’s a horror at the clients side.

And I can’t reproduce it. The page is not huge, it’s actually very OK in respect to the size (kBs) of the content. I guess I’ll have to have a glas of wine with the client and chill a bit.