Note that there are some explanatory texts on larger screens.

plurals
  1. POMagic Needed in Javascript/JQuery
    primarykey
    data
    text
    <p>I have navigation links in <code>li</code> placed at the bottom of the page, each of which has an image in itself. On mouse hover, on entering I have animated the li's top as negative of the size of image so that image slides up, and on mouse leaving I have made the top 0. </p> <p>The requirement includes a <code>div</code> which climbs up with each <code>li</code>, having some content, and drops down with the <code>li</code>. Now, the problem arises here, when I leave <code>li</code> to enter the mouse in <code>div</code>, the <code>li</code> drops taking the <code>div</code> with it. I have tried binding <code>mousemove</code> event on <code>mouseleave</code> which takes the mouse coordinates and check if the mouse is in the <code>div</code>, it worked fine but after trying the thing more than 4 or 5 times, it stopped animating the <code>div</code> each time, with no error on firebug.</p> <p>I have tried it with css including the <code>div</code> in <code>li</code>; but for every <code>li</code>, the <code>div</code> overlaps all the left <code>li</code>'s, otherwise it would have been a piece of cake. </p> <p>In the code below, the bgIdeas is the <code>div</code> referred above.</p> <p><strong>Javascript</strong></p> <pre><code> a.cache.brand_nav.find("li a").hover(function (c) { if (a.isTablet &amp;&amp; c.currentTarget.href !== f) d.location = c.currentTarget.href; else { c = b(this); c.stop(true, true).animate({ top: '-' + c.find("img").height() + 'px' }, 250, 'easeInCirc'); $('#bgIdeas').stop(true, true).animate({ bottom: '+' + c.find("img").height() + 'px' }, 500, 'easeInCirc', false); } }, function () { c = b(this); $('#bgIdeas').stop(true, true).animate({ bottom: '0px' }, 250, 'easeInCirc'); c.stop(true, true).animate({ top: '0px' }, 250, 'easeInCirc'); clearInterval(myRecFunc); $('.bgs').fadeIn(1000).show(); continueSlideShow(); }); </code></pre> <p>The commented code is the one in which I binded the mousemove event to stop the li from dropping down if pointer is on the div.</p> <p><strong>HTML</strong></p> <pre><code> &lt;ul class="clearfix"&gt; &lt;li&gt; &lt;a style="top: 0px;" href="#" title="Ideas" class="ideas"&gt; &lt;span class="top"&gt; &lt;span class="logo"&gt;Ideas&lt;/span&gt; &lt;span class="description"&gt;abc&lt;br&gt; Click Here&lt;/span&gt; &lt;span class="creator"&gt;&lt;small&gt;abc&lt;/small&gt;&lt;br&gt; Click Here&lt;/span&gt; &lt;/span&gt; &lt;img src="images/abc_thumb.jpg" alt="Ideas"&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a style="top: 0px;" href="#" title="def" class="def"&gt; &lt;span class="top"&gt; &lt;span class="logo"&gt;Def&lt;/span&gt; &lt;span class="description"&gt;Def&lt;br&gt; Click Here&lt;/span&gt; &lt;span class="creator"&gt;&lt;small&gt;Def&lt;/small&gt;&lt;br&gt; Click Here&lt;/span&gt; &lt;/span&gt; &lt;img src="images/def_thumb.jpg" alt="Def"&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a style="top: 0px;" href="#" title="ghi" class="ghi"&gt; &lt;span class="top"&gt; &lt;span class="logo"&gt;ghi&lt;/span&gt; &lt;span class="description"&gt;ghi&lt;br&gt; Click Here&lt;/span&gt; &lt;span class="creator"&gt;&lt;small&gt;ghi&lt;/small&gt;&lt;br&gt; Click Here&lt;/span&gt; &lt;/span&gt; &lt;img src="images/ghi_thumb.jpg" alt="ghi"&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a style="top: 0px;" href="#" title="jkl" class="jkl"&gt; &lt;span class="top"&gt; &lt;span class="logo"&gt;jkl&lt;/span&gt; &lt;span class="description"&gt;jkl&lt;br&gt; Click Here&lt;/span&gt; &lt;span class="creator"&gt;&lt;small&gt;jkl&lt;/small&gt;&lt;br&gt; Click Here&lt;/span&gt; &lt;/span&gt; &lt;img src="images/jkl_thumb.jpg" alt="jkl"&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a style="top: 0px;" href="#" title="mno" class="mno"&gt; &lt;span class="top"&gt; &lt;span class="logo"&gt;mno&lt;/span&gt; &lt;span class="description"&gt;mno&lt;br&gt; Click Here&lt;/span&gt; &lt;span class="creator"&gt;&lt;small&gt;mno&lt;/small&gt;&lt;br&gt; Click Here&lt;/span&gt; &lt;/span&gt; &lt;img src="images/mno_thumb.jpg" alt="mno"&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&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. 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