0👍
You appear to be using jQuery. Try including your JavaScript code with either the document.load event or the window.load event. Here’s an explanation of the difference.
https://coderwall.com/p/_jothq/jquery-when-to-use-document-ready-and-when-window-load
Source:stackexchange.com