title: issue updating variable on window resize
body: <p>I have a condition for a the size of the browser window but my variable "windowsize" doesnt get updated and only the value on document load is the one considered. What am I doing wrong, do I need a global variable?</p>
  
  <p>Here is what I have: </p>
  
  <pre><code>jQuery(function(){
      jcf.customForms.replaceAll();
      initCarousel();
      initCycleCarousel();
      initSlideShow();
      initOpenClose();
      initAccordion();
      jQuery('input, textarea').placeholder();
  
      .....
      ...
  
  });
  
  .....
  ...
  // open-close init
  function initOpenClose() {
  
  var $window = $(window);
  var windowsize = $window.width();
  
  $(window).resize(function() {
    windowsize = $window.width(); 
  });
  
    if (windowsize &gt; 1200) {
      //if the window is greater than 1200px wide then..
          jQuery('#nav &gt; ul &gt; li').openClose({
              activeClass: 'active',
              opener: '&gt; a',
              slider: '.drop-container',
              animSpeed: 200,
              event: 'over',
              effect: 'slideAlt'
          });
    }
    if (windowsize &lt; 1200) {
      //if the window is greater than 1200px wide then..
          jQuery('#nav &gt; ul &gt; li').openClose({
              activeClass: 'active',
              opener: '&gt; a',
              slider: '.drop-container',
              animSpeed: 400,
              event: 'click',
              effect: 'slideAlt'
          });
    }
  });
  </code></pre>
  
  <p>}</p>