title: jquery window resize event not working on initial load
body: <p>I know flex box is an option to change the orders of divs however I am using a bit of jquery instead of installing flexbox for one needed feature</p>
  
  <p>This is the script I am using which works fine when resizing the window</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).load($(window).bind("resize", listenWidth));
  
      function listenWidth( e ) {
          if($(window).width()&gt;910)
          {
              $(".loginblock").remove().insertAfter($("#step1"));
          } else {
              $(".loginblock").remove().insertBefore($(".regblock"));
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><h1>Problem:</h1>Although the script works well if you physically resize the browser window yourself. If I refresh the screen once the change has been made. It does not work. for example if I go to mobile size and refresh the loginblock goes back to the bottom instead of the top. </p>
  
  <p>Is there a simple way to edit my script to know what size the screen is on load and make the changes needed?</p>
  
  <p>Thanks!</p>