title: Click event doesnt work in safari mobile for some HTML content
body: <p>In my web app, there is a separate navbar for mobile devices. I want this navbar to collapse when the menu button is clicked or anywhere else in the site is clicked. It already works in any mobile browser but not it safari mobile (In safari also, for home page it works but not in other pages). In other pages, there are some html generated dynamically. It seems that the click event doesn't work for those content. I'd really appreciate a solution for this problem. the code is as follows. I've tried 'body', $(document), window instead of $('html'). It doesn't for them also.</p>
  
  <pre><code>$('html').click(function(event) {
              var clickover = $(event.target);
  var $navbar = $(".navbar-collapse");               
  var _opened = $navbar.hasClass("in");
  if (_opened === true &amp;&amp; !clickover.hasClass("navbar-toggle")) {      
      $navbar.collapse('hide');
  }
          });
  </code></pre>
  
  <p>I've also tried what is mentioned in <a href="http://www.danwellman.co.uk/fixing-jquery-click-events-for-the-ipad/" rel="nofollow">Fixing jQuery Click Events for the iPad</a>. But the code mentioned in there doesn't trigger at all. The code I've tried for this as belows.</p>
  
  <pre><code>var ua = navigator.userAgent,
  event = (ua.match(/iPad/i)) ? "touchstart" : "click";
  
  $('body').bind(event, function(e) {
              var clickover = $(event.target);
  var $navbar = $(".navbar-collapse");               
  var _opened = $navbar.hasClass("in");
  if (_opened === true &amp;&amp; !clickover.hasClass("navbar-toggle")) {      
      $navbar.collapse('hide');
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I'd really appreciate an answer for my question (I was working on this for more than a day but didn't find a solution). </p>