title: Raising a JavaScript event when a responsive nav collapse kicks in
body: <p>How can I call a JavaScript function when the 'nav collapse' feature of a responsive design kicks in?</p>
  
  <p>Specifically I'm looking at <a href="http://twitter.github.io/bootstrap/examples/hero.html" rel="nofollow">this</a> Bootstrap example. Resizing the browser window will toggle it on/off. I'm sure it's somewhere in Bootstrap's JS that checks the browser's size.</p>
  
  <p>Is there a simple way I could do something like <code>$(window).resize(x);</code> and in that function check to see whether the collapse has happened or not?</p>