Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't end jQuery fade on mouseout
    primarykey
    data
    text
    <p>I have a simple gallery style link setup using image swap on hover that I want to fade. I'm currently using `</p> <pre><code>.stop().hide().FadeTo("slow",1);` </code></pre> <p>to fade in the image triggered by mousing over one of the links on the left, here's a test site to see what I'm talking about </p> <p><a href="http://testsite00.hostoi.com" rel="nofollow">testsite00.hostoi.com</a> </p> <p>I can't figure out how to get the fade to end on mouseout. I'm trying to create a seamless fade between links but the fade is repeating on mouseout. Iv'e tried a number of combinations of .stop() and .hide() but can't seem to stop the effect from executing. Any ideas? Thanks in advance. </p> <p>jQuery:</p> <pre><code>$(document).ready(function() { // Image swap on hover $("#gallery ul li img").hover(function(){ $('#main-img').attr('src',$(this).attr('src').replace('thumb/', '')) function() { //mouseenter handler $(this).stop().fadeTo("slow",0.5); } function (){ //mouseleave handler $(this).stop().fadeTo("slow",1.0); } }); </code></pre> <p>HTML:</p> <pre><code>&lt;div id="gallery"&gt; &lt;img src="images/gallery/home.png" alt="" id="main-img" /&gt; &lt;ul&gt; &lt;li class="home"&gt;&lt;img src="images/gallery/thumb/home.png" alt="" /&gt;&lt;/li&gt; &lt;li class="about"&gt;&lt;img src="images/gallery/thumb/about us.png" alt="" /&gt;&lt;/li&gt; &lt;li class="contact"&gt;&lt;img src="images/gallery/thumb/Contact Us.png" alt="" /&gt;&lt;/li&gt; &lt;li class="services"&gt;&lt;img src="images/gallery/thumb/Services.png" alt="" /&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre>
    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.
 

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