title: Load a jquery event only after the preloader ends
body: <p>My website is : <a href="https://365arts.me/" rel="nofollow noreferrer">https://365arts.me/</a></p>
  
  <p>So it loads about 16mbs of pics(Yes I know, I'm stupid. I'll try to change it very soon, also if someone could tell me a way to reduce size of do something else(like dynamic loading only when needed, if something like that exists) I'd be very grateful). </p>
  
  <p>I added a preloader for it using: </p>
  
  <p>[html]:</p>
  
  <pre><code>&lt;div class="spinner-wrapper"&gt;
      &lt;div class="spinner"&gt;
      &lt;div class="dot1"&gt;&lt;/div&gt;
      &lt;div class="dot2"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and corresponging [jquery]:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  //Preloader
  $(window).on("load", function() {
  preloaderFadeOutTime = 500;
  function hidePreloader() {
  var preloader = $('.spinner-wrapper');
  preloader.fadeOut(preloaderFadeOutTime);
  }
  hidePreloader();
  });
  });&lt;/script&gt;
  </code></pre>
  
  <p>this works well but the problem is I have a javascript code that comes and says Hi! but it runs only for 2.8 seconds. So if loading takes up more than that, It doesnt show up. Can someone please tell me how to make sure that it loads only exactly after loading is completed.</p>
  
  <p>Thanks a ton.</p>
  
  <p>Code for my website:</p>
  
  <p><a href="https://github.com/richidubey/365-Days-Of-Art/blob/master/index.html" rel="nofollow noreferrer">https://github.com/richidubey/365-Days-Of-Art/blob/master/index.html</a></p>