Why doesn't my jQuery script see that I've changed the class of an element?
<p>I have this super simple jQuery script that I'm having trouble getting to work. I'm certainly missing something as I've done things exactly like this before with no problem.</p>

<p>Codepen link: <a href="http://codepen.io/jimmykup/full/pjJhC" rel="nofollow">http://codepen.io/jimmykup/full/pjJhC</a></p>

<pre><code>$("div.minimize").click(function() {

    alert("Changing to RED");
    $(this).removeClass('minimize');
    $(this).addClass('maximize');

});

$("div.maximized").click(function() {

    alert("Changing to BLUE");
    $(this).removeClass('maximize');
    $(this).addClass('minimize');

});
</code></pre>

<p>The problem is that once my <code>&lt;div&gt;</code>'s class has been changed to <code>.maximize</code> the jQuery continues to run as if the class is still <code>.minimize</code>.</p>
