jQuery .toggle() called by window.setInterval() not functioning
<p>I am trying to alternate between two logos every 5 seconds using the following code:</p>

<pre><code>window.setInterval(
    function () {
        //breakpoint 1
        $("#logo").toggle(
            function() {
                //breakpoint 2
                $(this).attr('src', '/Images/logo1.png');
            },
            function() {
                //breakpoint 3
                $(this).attr('src', '/Images/logo2.png');
            }
        );
    },
    5000
);
</code></pre>

<p>I can get a simple toggle to work, but when I introduce the toggle within window.setInterval(), the toggle's two handlers won't fire.</p>

<p>I set breakpoints on the lines directly beneath the comments in the code above.  Breakpoint 1 hits every 5 seconds.  However, Breakpoint 2 and 3 never hit.</p>

<p>Why are neither of the toggle function's handlers firing?</p>
