title: Swapping divs at certain browser width
body: <p>I have a small snippet of code I have been working on to swap two divs around when the browser width drops below 768, my issue with what I have is it works but only when you resize the window, not when it loads below 768, also when you expand the window back full screen it doesn't swap the divs back, any help would be appreciated. <a href="http://jsfiddle.net/kellyhawker/q8mctsds/" rel="nofollow">Fiddle here</a></p>
  
  <pre><code>    $(window).on('resize', function (event) {
          var windowWidth = $(window).width();
          if (windowWidth &gt; 768) {
              jQuery(".swap2").after(jQuery(".swap1"));
          }
      });
  </code></pre>