Problem with setInterval
<p>I have a problem with setInterval on a 'click' event. Im already spawning a hidden div. But I want spawn and fade in synced and only run the fade in ones.</p>

<pre><code> var anchor = document.getElementById('anchor');
                var hiddenElement = document.getElementById('hiddenElement');
                var bkgFade = document.getElementById('bkgFade');

                anchor.addEventListener('click', spawnImage, false);
                hiddenElement.addEventListener('click', despawnImage, false);
                function spawnImage() {
                     setInterval(function() {
                        document.getElementById('hiddenElement').style.display = 'block';
                        document.getElementById('bkgFade').style.visibility = 'visible';
                         hiddenElement.style.opacity += 1.0;
                    } 1000);


                }

                function despawnImage() {
                    document.getElementById('hiddenElement').style.display = 'none';
                    document.getElementById('bkgFade').style.visibility = 'hidden';
                }
</code></pre>
