JQuery addClass not working with switch statement and is directive
<p>addClass doesn't seem to work under certain circumstances for me. Have a look at the following code:</p>

<pre><code>$("#my-div-container .my-sub-div li a").live('mouseover', function(e){
    e.preventDefault();

    var li_parent_elem = $(this).parent();
    li_parent_elem.siblings().removeClass();

    switch(true)
    {
        case (li_parent_elem.is("#my-div-container .my-sub-div li:first-child") == true):
            //alert("First");
            li_parent_elem.addClass("first");
        break;

        case (li_parent_elem.is("#my-div-container .my-sub-div li:last-child") == true):
            //alert("Last");
            li_parent_elem.addClass("last");
        break;

        default:
            //alert("Mid");                     
            li_parent_elem.addClass("mid");
    }
});
</code></pre>

<p>addClass doesn't work for the first two case statements, only the default. However, when I uncomment the alert directives, I get the correct alert so I know the conditional statement is working.</p>

<p>I'm not sure what is wrong here, and I'd appreciate some assistance.</p>
