How to test if a jQuery selectors condition is more than 2 times?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4979738/fire-jquery-event-on-div-change">Fire jQuery event on div change</a>  </p>
</blockquote>



<p>I'm using this tiny plugin to watch for changes in the html: <a href="https://github.com/jacobrelkin/jquery-watcher" rel="nofollow">https://github.com/jacobrelkin/jquery-watcher</a></p>

<p>This works fine, the problem is I need the <code>if condition</code> to validate if it's over 2 times, reason being when the gallery loads and it shifts left and right creates the <code>-moz-grabbing</code> condition twice onload.</p>

<p>I tried doing </p>

<pre><code>  if(  $('#gallery-1').has('div').css('cursor', '-moz-grabbing') &gt; 2)
  if(  $('#gallery-1').has('div').css('cursor', '-moz-grabbing').length &gt; 2)
</code></pre>

<p>I also tried putting it in a variable then doing <code>&gt; 2</code></p>

<p>None of the above seem to be working not sure what I'm doing wrong?</p>

<pre><code>$('.sliderContainer').watch('innerHTML', function() {
    if(  $('#gallery-1').has('div').css('cursor', '-moz-grabbing') ) {
        console.log($('#gallery-1').has('div').css('cursor', '-moz-grabbing'));
        $('#collapse_content_1').toggleClass('collapse_inner_off');
    }
});
</code></pre>
