title: $(window).resize function in live time
body: <p>I have this problem, I need <code>script</code> should work in live time
  when I resize browser window less than 340px alert window is less than 340px 
  and it should happened only one time when <code>$(window)</code> size is less then 340px or more 340px
  it should be every resize less then 340px or more</p>
  
  <pre><code>if($(window) &lt; 340){
       alert("window is less than 340px");
      }else{
      alert("123");
      }
  </code></pre>