title: Do something when window width less than 766px
body: <p>I'm trying to make responsive drop-down menu bar, and I want to set different jQuery event between PC and Mobile.</p>
  
  <p>So I made some jQuery events that... </p>
  
  <p>Do something if window width less than 767px or else....  </p>
  
  <p>This is my code here.</p>
  
  <pre><code>$(document).ready(function(){
      if ($(window).width() &lt; 767) {   
          $('.mGnb a').click(function() {
              $('#subLayer').slideToggle(200);
              return false;
          });  
      }
      else {  
          $('.mGnb a').hover(function() {
              $('#subLayer').slideUp(200);
              return false;
          });  
      }); 
  }); 
  </code></pre>
  
  <p>It works fine. But the problem is when I resize the window, jQuery doesn't work. It works when I resize and Refresh(F5) the page.</p>
  
  <p>What do I need to fix it ?</p>