Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since you've tagged with jQuery, why not just use the jQuery <a href="http://api.jquery.com/fadeIn/" rel="nofollow noreferrer">fadeIn</a> function?</p> <pre><code>$("#searchresults").fadeIn(200); </code></pre> <p>Note that if you want to be notified when the fade in is complete, you can pass a callback</p> <pre><code>$("#searchresults").fadeIn(200, function() { changeborder(); }); </code></pre> <p>Also, a few words on your original code.</p> <pre><code>setTimeout("searchresults.style.visibility = 'hidden'", 200); </code></pre> <p>will simply wait 200ms, and then hide your element named <code>searchresults</code>. To actually fade it, you'll want to use the fadeIn function above. </p> <p>And in the future, instead of code like</p> <pre><code>setTimeout("searchresults.style.visibility = 'hidden'", 200); </code></pre> <p>which passes the JavaScript to be run after the timeout as a <strong>string</strong>, you'll really want to pass a <strong>function</strong>. And instead of referring, to your dom elements by id in your script, you'll want to pull them down using <code>document.getElementById</code></p> <pre><code>setTimeout(function() { var el = document.getElementById("searchresults"); el.style.visibility = 'hidden'; }, 200); </code></pre> <p>For a brief explanation of why passing a string to setTimeout is bad, have a look <a href="https://stackoverflow.com/questions/6081560/is-there-ever-a-good-reason-to-pass-a-string-to-settimeout">here</a>. The short version is that the string is run in the global scope in a similar way to <code>eval</code></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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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