Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery: Repeated (undesired) fading in/out in Firefox
    primarykey
    data
    text
    <p>I am just now beginning to explore jQuery (v1.4.2) and have constructed a small, static example for purposes of self-education.</p> <p>I'm using Firefox 3.6.9, Chromium 6.0.472.53 and Opera 10.61 on the Linux platform.</p> <p>I find that my example works as expected on Chromium and Opera, but I get a very annoying flickering behavior of jQuery fadeIn happening twice on Firefox.</p> <p>I'm wondering if anyone else has experienced the same issue or if there are any known workarounds.</p> <p>Here's the code:</p> <p>index.html</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script src="main.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="mainDiv"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>main.js</p> <pre><code>function showA1() { $.get("zh1.html", function(data){$("#mainDiv").html(data);}); } function showB2() { $.get("zh2.html", function(data){$("#mainDiv").html(data);}); } function clickA1() { $("#mainDiv").fadeOut(showB2); $("#mainDiv").fadeIn(); } function clickB2() { $("#mainDiv").fadeOut(showA1); $("#mainDiv").fadeIn(); } function executeWhenReady() { showA1(); } $(document).ready(executeWhenReady); </code></pre> <p>zh1.html</p> <pre><code>&lt;div&gt;Button A1&lt;/div&gt;&lt;a href="javascript:clickA1();"&gt;&lt;button id=A1&gt;First button&lt;/button&gt;&lt;/a&gt; </code></pre> <p>zh2.html</p> <pre><code>&lt;div&gt;Button B2&lt;/div&gt;&lt;a href="javascript:clickB2();"&gt;&lt;button id=B2&gt;Second button&lt;/button&gt;&lt;/a&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.
 

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