title: jQuery: How to bind an event for the div when it becomes visible?
body: <p>I've got a div element: 
  <code>&lt;div id="tab1"&gt;
      Tab data
  &lt;/div&gt;</code>.</p>
  
  <p>How to bind a custom event when this div becomes visible (gets <code>display: block;</code>)?</p>
  
  <p>And also I'd like to bind an event when this div becomes invisible (gets <code>display: none;</code>). </p>
  
  <p>I'd like to do this in jQuery.</p>
  
  <p>Edit:
  I'm making simple tabs with ajax content. I want the content on this tabs to be ajax-updated only when the tab is visible.</p>