Blank space, where slider should be - Autoptimize plugin

Problem:

  • Slider doesn't load, only an empty space
  • Autoptimize plugin is used
  • TypeError: window.n2jQuery is undefined

Solution:

Autoptimize changes the file loading order so some of our codes are not ready yet when they're needed.

Turn on the  Async options at the Nextend Settings, because this will make our slider to call in it's JavaScript files differently.

If that won't work Autoptimize has an option at the JavaScript Options called Force JavaScript in <head>. This option is moving JavaScript codes from the body into the head, but not in the order, as it should be, so it's causing the problem, and you should turn off this setting.

But the JavaScript merging and minification of this plugin is causing errors in many plugins, which are making our slider to not to load, so you could turn that off.

If you can't see these options, turn on the Show advanced settings on the top right:

If you don't have Autoptimize installed, check out this documentation instead.