Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery, issue with mouseEnter and slideToggle
    primarykey
    data
    text
    <p>I made a little jquery script, when the mouse is over a div .frame, it is slidetoggleing two divs: .contentTop and .contentBottom It's working well but I have some issues when I'm applying the script to 2 divs, first when I'm moving really fast the mouse from one div .frame to the other one it mess the script, then when the mouse is over .frame I would like .contentBottom to be over the other.frame</p> <p>my css are:</p> <pre><code> .frame{ background-color: #FFFFFF; position:relative; width:40%; } .contentTop { position:absolute; display:none; background-color: #FFFFFF; } .contentBottom { position:absolute; background-color: #FFFFFF; display: none; } </code></pre> <p>and my jquery:</p> <pre><code>$(document).on('mouseenter', '.frame', function() { var el = $(this); var hauteur = el.height(); var largeur = el.width(); contentBottom = el.children(".contentBottom"); contentTop = el.children(".contentTop"); contentTop.css({"bottom":hauteur,"width":largeur}); contentTop.html('top top top top'); contentBottom.html('bottom bottom bottom bottom&lt;br&gt;bottom bottom bottom bottom&lt;br&gt;bottom bottom bottom bottom&lt;br&gt;bottom bottom bottom bottom&lt;br&gt;'); contentBottom.css({"top":hauteur,"width":largeur}); contentBottom.stop(true, true).slideToggle(300); contentTop.stop(true, true).slideToggle(300); }).on('mouseleave','.frame', function() { var el = $(this); contentBottom = el.children(".contentBottom"); contentTop = el.children(".contentTop"); contentTop.stop(true, true).slideToggle(300, function(){ contentTop.html(''); }); contentBottom.stop(true, true).slideToggle(300, function(){ contentBottom.html(''); }); }); </code></pre> <p>I made a jsfiddle here: <a href="http://jsfiddle.net/malamine_kebe/2ANkq/2/" rel="nofollow">http://jsfiddle.net/malamine_kebe/2ANkq/2/</a></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