javascript animate opacity,should be easy
<p>ok so in learning this javascript here, im wanting to create a
panel in my html that when a button is clicked, whatever content is in that div, is
faded out and the new content fades in...like..like for example, a jquery gallery.</p>

<p>but since im learning i wanna do it myself.</p>

<p>that said, im trying to animate the opacity of a dummy div like so:</p>

<pre><code>&lt;script&gt;
var daBox = document.getElementById("box");
var hmm;

function beginAnimBox (){
    daBox.style.opacity = 1;
    hmm = setInterval(animBox,5000);

}


function animBox(){
    if(daBox.style.opacity == "1"){
        daBox.style.opacity = -0.1;

    }
}


window.onload = function(){
    beginAnimBox(); 
}
&lt;/script&gt;
</code></pre>

<p>something like this as an example.
logic being (dunno if it makes sense)is that every x seconds, do the code to reduce the color value by .1 until 0.</p>

<p>then when fully opague, ill write something later to bring in the new content.</p>

<p>any ideas, tips, links etc.</p>
