Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to delay mousover part of hover() function in jquery and to be only executed when cursor is on the element for some given duration
    primarykey
    data
    text
    <pre><code>&lt;ul id="menu"&gt; &lt;li&gt;What's new? &lt;ul class="active"&gt; &lt;li&gt;&lt;a href="#"&gt;Weekly specials&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Last night's pics!&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Users' comments&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Member extras &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Premium Celebrities&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;24-hour Surveillance&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;About Us &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Privacy Statement&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Terms and Conditions&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;/li&gt; &lt;/ul&gt; </code></pre> <p>Jquery code:</p> <pre><code> &lt;script&gt; $(document).ready(function(){ $('#menu&gt;li&gt;ul&gt;li').hide(); $('#menu&gt;li').click(function(e){e.stopPropagation();}); $('#menu&gt;li').hover( function(){ t=$(this); $(t).find('ul&gt;li').slideToggle(); }, function(){ $(t).find('ul&gt;li').slideToggle(); } ); }); &lt;/script&gt; </code></pre> <p>i want to make a vertical menu list with sub lists which expands when mouse is hovered on it and collapse when mouse is out . The above mention code works well but the only thing is while moving the cursor from downwards to upwards across the list every item till i reach top of the list expands and collapse.What should i include to avoid this behavior so that list item will expand only when cursor is resting on it for some duration(say 500 milisecs) </p>
    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.
 

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