using hoverIntent.js - need to affect style on a menu item

using hoverIntent.js - need to affect style on a menu item

Hi all. I'm not great with JS, but am trying to wade through it. I'm using the tutorial offered  here to build a dropdown navigation mega menu :).

Here's my js code:

  1. <script type="text/javascript"> 
  2. $( document ).ready( function ()
  3. {
  4. //magazine menu
  5. //Set custom configurations for dropdown menu
  6. var config = {
  7. sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
  8. interval: 50, // number = milliseconds for onMouseOver polling interval
  9. over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
  10. timeout: 300, // number = milliseconds delay before onMouseOut
  11. out: megaHoverOut // function = onMouseOut callback (REQUIRED)
  12. };
  13. $("ul#main-nav li .sub").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
  14. $("ul#main-nav li").hoverIntent(config); //Trigger Hover intent with custom configurations
  15. }
  16. );

  17.         //hover for magazine dropdown
  18. //On Hover Over -> http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/
  19. function megaHoverOver(){
  20. $(this).find(".sub").stop().fadeTo('fast', 1).show(); //Find sub and fade it in
  21. }
  22. //On Hover Out
  23. function megaHoverOut(){
  24. $(this).find(".sub").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
  25.  $(this).hide();  //after fading, hide it
  26.  });
  27. }
  28. </script> 
and my HTML code:

  1. <ul id="main-nav">
  2.             <li><a href="/" id="home" class="current">home</a></li>
  3.             <li><a href="#" id="magazine">magazine</a>
  4.               <div class="sub">
  5.                 [blah] content goes here
  6.               </div>
  7.             </li>
  8.           </ul>

it all works beautifully, except the fact that the nav item takes a :hover attribute that doesn't stay put while the user mouses over the mega menu. the css looks like this:

  1. ul#main-nav li a#magazine:hover{
  2. background-color:#a5abaf;
  3. color:black;
  4. }

I tried adding a css class to that menu object on the Hover Over function, but the mouse out event still turns the menu item back to its default color. Any ideas?

Thanks!