Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery on hover out the element still retains the hovered class. This class styles should be removed when the mouse is hovered out
    primarykey
    data
    text
    <p>I want the login-btn to remain in its hover state when mouse is hovered over .login-content. I have already attempted at this, and for now it shows and hides the div on hover, but the login-btn loses its hover state when the .login-content is hovered, and the the .login-content disappears when it is hovered.</p> <p><b>Update:</b> <br />Current Issue is that the if the mouse is hovered over login and then directly hovered off.. instead of hovering over the child elements, the .hovered styles stays. This shouldnt be this way.</p> <p>The HTML is as follows:</p> <pre><code> &lt;li&gt;&lt;a href="#" class="login-btn"&gt;Login&lt;/a&gt; &lt;div class="login-content"&gt; &lt;form name="login-form" action="" method="post"&gt; &lt;input type="email" name="email" value="" placeholder="E-mail" /&gt; &lt;input type="password" name="password" value="" placeholder="Password" /&gt; &lt;input type="submit" name="login" value="Login" class="form-login" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;/li&gt; </code></pre> <p>The jQuery code is as follows:</p> <pre><code>$(document).ready(function () { $(".login-btn").hover( function() { clearTimeout($(this).data('hoverTimeoutId')); $(".login-content").show(); $(this).addClass('hovered'); }, function() { clearTimeout($(this).data('hoverTimeoutId')); $(this).data('hoverTimeoutId', setTimeout(function () { $(this).removeClass('hovered'); $(".login-content").hide(); } ,500)); }); $('.login-content').hover( function(){ clearTimeout($(".login-btn").data('hoverTimeoutId')); }, function(){ $(".login-content").hide(); $(".login-btn").removeClass('hovered'); }); }); </code></pre> <p>The webpage can also be found at <a href="http://www.domainandseo.com/portfolio/1may/index.html" rel="nofollow">http://www.domainandseo.com/portfolio/1may/index.html</a> if any further debugging is needed.</p> <p>Thanks</p>
    singulars
    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