Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand correctly, you should be looking to do something like this. I've changed the <code>$(this)</code> selector you were using, to be a little more specific to the element that is being moved. Rather than the entire <code>li</code> , we are selecting the <code>.ch-item</code> of the hovered <code>li</code>.</p> <p>Additionally, the <code>.hide() .show()</code> methods have been changed to <code>.fadeIn() and .fadeOut()</code>.</p> <p>In our animations, we can return the element back to its original position by moving it to <code>0px</code>. We can do this because the element is relatively positioned, and not absolutely positioned. If you have any questions let me know!</p> <p><a href="http://jsfiddle.net/2ZKG3/8/" rel="nofollow">http://jsfiddle.net/2ZKG3/8/</a></p> <pre><code>$('.ch-grid li').hover(function () { $('.ch-item', this).stop().animate({'left': '-100px'}, 300); $('.bioinfo', this).stop().fadeIn(300).css('display','inline-block'); }, function () { $('.ch-item', this).stop().animate({'left': '0px'}, 300); $('.bioinfo', this).stop().fadeOut(300); }); .ch-img-1 { position: relative; background-image: url(https://lh4.googleusercontent.com/9Difi9bypu9-FoUsfFWpX6odYLLjXQk_q0aPxZBSFynecMOSLoKRKWRWIfZdXRGOdXMZCahrLBG6vWrwIeT-A26iDjTucgFVCP0Fuzr79BHW5kLJ3sw); width: 100px; height: 100px; background-size: 100px; display: inline-block; z-index: 2; } .bioinfo { display: none; background: rgba(246, 246, 246, 0.8); font-size: 10px; padding: 10px 20px; text-align: justify; position: absolute; left: 50px; margin-top: 20px; } </code></pre> <p>Let me know if that isn't the desired effect you are going for. Hope this helps!</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.
    1. This table or related slice is empty.
    1. 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