jQuery add class if dropdown active, else remove class
<p>I have a script that looks if the <strong>unordered list</strong> is visible, if it is, it will add a class. My problem is, it's not removing the class. Probably a noobie error, help appreciated though.</p>

<p>HTML:</p>

<pre><code>&lt;div class="nav"&gt;
  &lt;ul id="menu" class="menu"&gt;
    &lt;li id="menu0"&gt;&lt;a href="/page/"&gt;IT Solutions&lt;/a&gt;
    &lt;!-- dropdown --&gt;
    &lt;ul&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;dropdown link&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;!-- end dropdown --&gt;
    &lt;/li&gt;
&lt;/div&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>$('#menu li').live('mouseenter mouseleave', function(e) {    
  var element = $(this).find('ul');

  if ((element).is(':visible')) {
    $(this).addClass('hilight');
  }
  else {
    $(this).removeClass('hilight');
  }
}); 
</code></pre>

<p>I am using <code>live</code> because i am having to work with an old version of jQuery.</p>
