Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This sounded like fun, so I implemented it. From the looks of things, your css selector can be simplified. I think you only want the topmost list item to fade in and out, but it's not clear from the example. This example highlights the topmost node and does the fading correctly. I think this is the effect you were going for, but I'm not 100% sure. I didn't use the wait() functionality, as I'm not sure what it does do you.</p> <p>Essentially, it sounds like the problem you are running into is that you are fading items in on hover out when you haven't left the list yet. You only want to fade in the list or other list items when you've entirely left the list. Don't use hoverIntent for that part, and handle the fading on the entire unordered list and it should be good to go.</p> <p>The example: <a href="http://jsbin.com/usobe" rel="noreferrer">http://jsbin.com/usobe</a></p> <p>Tinker with the example: <a href="http://jsbin.com/usobe/edit" rel="noreferrer">http://jsbin.com/usobe/edit</a></p> <pre><code>&lt;ul id="sites"&gt; &lt;li&gt; site 1 &lt;ul&gt;&lt;li&gt;sub item 1&lt;/li&gt;&lt;li&gt;sub item 2&lt;/li&gt;&lt;li&gt;sub item 3&lt;/li&gt;&lt;/ul&gt; &lt;li&gt; site 2 &lt;ul&gt;&lt;li&gt;sub item 1&lt;/li&gt;&lt;li&gt;sub item 2&lt;/li&gt;&lt;li&gt;sub item 3&lt;/li&gt;&lt;/ul&gt; &lt;li&gt; site 3 &lt;ul&gt;&lt;li&gt;sub item 1&lt;/li&gt;&lt;li&gt;sub item 2&lt;/li&gt;&lt;li&gt;sub item 3&lt;/li&gt;&lt;/ul&gt; &lt;li&gt; site 4 &lt;ul&gt;&lt;li&gt;sub item 1&lt;/li&gt;&lt;li&gt;sub item 2&lt;/li&gt;&lt;li&gt;sub item 3&lt;/li&gt;&lt;/ul&gt; &lt;li&gt; site 5 &lt;/ul&gt; &lt;script&gt; $(function() { $("#sites").hover( function() {}, function() { $('#sites&gt;li').fadeTo("fast", 1.0); } ); $("#sites&gt;li").hoverIntent( function(){ $(this).attr('class', 'current'); // Add class .current $(this).siblings().fadeTo("fast", 0.3); // Fade other items to 30% $(this).fadeTo("slow", 1.0); // Fade current to 100% }, function(){ $(this).removeClass("current"); // Remove class .current $(this).fadeTo("fast", 1.0); // This should set the other's opacity back to 100% on mouseout }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload