title: get wrong value when window resize
body: <p>First, I get the window width and minus something then assign it to a variable, </p>
  
  <p>Second, I resize the window and want to get the value that is current window width minus something</p>
  
  <p>but I get wrong value, it will alert two value one is right and another is wrong,I do not know why and how to fix it, help me, thx</p>
  
  <p>my html code is </p>
  
  <pre><code>&lt;p class="test"&gt;click me get value&lt;/p&gt;
  </code></pre>
  
  <p>js is </p>
  
  <pre><code>(function(){
  
  test();
  
  $(window).resize(function(){
  test();
  });
  
  }());
  
  
  
  function test() {
      var t = $(window).width()-74;
      alert('one ' +t);
      $(document).on('click', '.test',{t: t}, get);
  }
  function get(event) {
      var l = event.data.t
      alert('two ' +l)
  }
  </code></pre>
  
  <p>the fiddle version is 
      <a href="http://jsfiddle.net/dxcqcv/xetbhwpv/1/" rel="nofollow">http://jsfiddle.net/dxcqcv/xetbhwpv/1/</a></p>