title: how to use Jquery :focus selector on input elements in iOS?
body: <p>I'm using Jquery 1.7.1 and iPad1 iOS3.</p>
  
  <p>I need to fire a function on scrollstart unless an input element has focus. The function below worked for a long time, but all of a sudden it doesn't (looking aroud I guess because of switching to Jquery 1.7.1)</p>
  
  <pre><code>$(document).on('scroll', function(){
     if ( !$("input:focus").length &gt; 0 ) {  
         self.hideAllPanels();
         }
    });
  </code></pre>
  
  <p>Specifically <strong>$('input:focus').length = 0</strong>, although I can detect the focus event triggering before the scroll event.</p>
  
  <p>I have been fiddling with a workaround using:</p>
  
  <pre><code> if ( !$(document.activeElement).get(0).tagName == "input" ){
   ....
   }
  </code></pre>
  
  <p>But I'm not sure when the activeElement is changing, because it seems to persist for quite a while even after I'm "leaving" the resprective element.</p>
  
  <p><strong>Question</strong>:<br>
  Any idea why I can't detect the focus-ed element on iOS? Some hints how I could set this up with activeElement, so on blur, I'm no longer having the input as activeElement are also welcome!</p>
  
  <p>Thanks for help!</p>