Note that there are some explanatory texts on larger screens.

plurals
  1. POImage overlay animation, can't select overlay without animation loop
    primarykey
    data
    text
    <p>I'm trying to write my own image overlay animation. My main problem is the animation won't let me select the overlay. I want to put a link in it. The animation also doubles up sometimes. I've tried to use <code>stop()</code> but to no avail. Can someone give me some advice as to where I'm going wring with this?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript" src="jquery-1.8.2.min.js"/&gt;&lt;/script&gt; &lt;style&gt; #home_sec_2 {z-index:20; position:relative; display:inline-block}.hide{display:none;} #home_sec_2 img{outline:0;text-decoration:none; display: inline-block;float:left;} .imgOverLay1{height:70px; width:314px; background-color:#F01414; display:none; float:left; z-index:8000; position: absolute; opacity: 0.5;filter:alpha(opacity=50);-moz-opacity:0.5;-khtml-opacity: 0.5;bottom: 0px; float:left;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="home_sec_2"&gt; &lt;h2&gt;WHATS IN THE MIX&lt;/h2&gt; &lt;div class="imgOverLay1" id="ov0"&gt;Here is the First&lt;/div&gt; &lt;img src="midimg1.png" width="314" height="145" class="c1" alt="LA NORIE"/&gt; &lt;div class="imgOverLay1" id="ov1"&gt;Here is the Second&lt;/div&gt; &lt;img src="midimg2.png" width="314" height="145" class= "c1" alt="BATTLEFIELD 3" /&gt; &lt;div class="imgOverLay1" id="ov2"&gt;Here is the Third&lt;/div&gt; &lt;img src="midimg3.png" width="314" height="145" class="c1" alt= "CALL OF DUTY: MW3" /&gt; &lt;/div&gt;&lt;/body&gt; &lt;script&gt; $(function(){ $("#home_sec_2 img").attr("id", function (arr) { return arr; }); $('#home_sec_2').on('mouseover','img',function(){ position = $(this).position().left; var $ll = $(this).attr('id'); console.log(this); $('#ov'+$ll).css({left:position}); $('#ov'+$ll).addClass('shown'); $('#ov'+$ll).slideToggle('slow'); var $this = $('#ov'+$ll); console.log($this); }), $('#home_sec_2').on('mouseleave','img',function(){ $ll = $(this).attr('id'); $('#ov'+$ll).slideToggle('slow'); console.log($('#ov'+$ll)); }) }); &lt;/script&gt; &lt;/html&gt; </code></pre> <p>If i put my mouse over the overlay the animation <code>slideToggle</code> finishes and hides the div.</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