slideToggle dropdown menu WITHOUT nested lists
<p>So my problem is that I've got a main navigation with a dropdown menu underneath "products". I positioned the dropdown menu, set it to display: none, then wrote jQuery to slideToggle the menu when a particular LI is hovered over. The issue is that when I hover over the "Products" LI and try to hover over the dropdown, it disappears because I'm no longer hovering over that LI.</p>

<p>You're probably thinking "Just make nested lists!!!!". Well, I don't want to. I've got some jQuery being applied to the main navigation that I don't want to effect the dropdown. I just want a way to be sure the dropdown is open when the mouse is hovered over either the main LI or the dropdown UL and that the dropdown is closed when the mouse is hovered over neither.</p>

<p>In my code I've tried to make it so that if the mouse is over the dropdown UL it stays open, but the mouse leaving the LI trumps that maybe? HELP PLEASE! My HTML and jQuery is below.</p>

<p>Link to the entire page I'm working on: <a href="http://heylush.net/driven/" rel="nofollow">http://heylush.net/driven/</a></p>

<p>HTML:</p>

<pre><code>              &lt;ul id="topnav"&gt;
                    &lt;li class="home"&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="aboutus"&gt;&lt;a href="#"&gt;About Us&lt;/a&gt;&lt;/li&gt;
                    &lt;li class="products" class="drop1"&gt;&lt;a href="#"&gt;Products&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Industries&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;News&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Partners&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;&lt;!--#topnav--&gt;
              &lt;ul id="products-nav"&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Overview&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Roadside Assistance&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Tire &amp;amp; Wheel&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Key Replacement&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Dent Repair&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;img src="images/nav-arrow.png" /&gt;&lt;a href="#"&gt;Windshield Protection&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;&lt;!--#products-nav--&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>        $(document).ready(function() {
            $('ul#products-nav').css('display', 'none');
            $('li.products').mouseenter(function(){
                $('ul#products-nav').slideToggle('medium');
            }).mouseleave(function(){
                $('ul#products-nav').slideToggle('medium');
            });
            $('ul#products-nav').mouseenter(function(){
                $(this).css('display', 'block');
            }).mouseleave(function(){
                $(this).css('display', 'none');
            });
            $('ul#products-nav li').mouseenter(function(){
                $(this).children('img').replaceWith('&lt;img src="images/hover-arrow.png" /&gt;');
                $(this).children('a').css('color', '#6da3e0');
            }).mouseleave(function(){
                $(this).children('img').replaceWith('&lt;img src="images/nav-arrow.png" /&gt;');
                $(this).children('a').css('color', '#2160ac');
            });
        });
</code></pre>
