jQuery stops working in specific situation
<p>I have this really weird bug at my page. I wrote this comment system that when you add a comment it adds the new comment with a nice animation (unhides it by animating the height). Not the problem is, when you add a long comment (close to the max characters allowed) and after that add another one, the last animation stops when the height is 1px and all other animations on the page (like hovers) stop working as well. I have no idea what is causing this.</p>

<p>Here's the link to my page <a href="http://ttrcustoms.us/testarea51/#track=1323924558" rel="nofollow">http://ttrcustoms.us/testarea51/#track=1323924558</a></p>

<pre><code>function addComment(el, evenorodd, user, avatar, comments){
numberofcomments = parseInt(comments);
newnumberofcomments = numberofcomments;
realnumberofcomments = numberofcomments + 1;
numberofcomments--;
theLastID = "#commentborder" + numberofcomments;
deleteLast = "#delete" + numberofcomments;
fadeLast = "#fade" + numberofcomments;
theCommentID = "#thecomment" + newnumberofcomments;
newcomment = "#fade" + newnumberofcomments;
commentID = "#comment" + newnumberofcomments;
commentBorderID = "#commentborder" + newnumberofcomments;

if (window.XMLHttpRequest){
    // code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
}else{
    // code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

//Fade textarea
$("#enter-comment").attr("readonly", true).fadeTo(500, 0.5);

xmlhttp.onreadystatechange=function(){
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){
        //Add the comment from the DB
        document.getElementById("serverResponse").innerHTML=xmlhttp.responseText;

        if(xmlhttp.responseText != "success"){
            //Show error if there is one
            jQuery.fn.center = function (widthmodification, heightmodification) {
                this.css("position","fixed");
                this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + heightmodification + "px");
                this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + widthmodification + "px");
                return this;
            }
            $("#serverResponse").center(-32, -75);
            $("#pageoverlay").fadeTo(500, 0.75);
            $("#serverResponse").fadeIn(500);

            $("#pageoverlay").click(function() {
              $("#serverResponse").fadeOut(500);
              $("#pageoverlay").fadeOut(500);
              $(deleteimg).html("&amp;#x2716;");
              $("#enter-comment").fadeTo(500, 1);
            });
        }else{
            //Show the comment
            $(fadeLast).after("\n&lt;span id='fade"+newnumberofcomments+"' class='fadecomment' onmouseover='$(\"#delete"+newnumberofcomments+"\").fadeTo(200,1);' onmouseout='deleteOut(event, \""+newnumberofcomments+"\")' style='display: none; width: 679px;'&gt;\n&lt;span class='comment' id='comment"+newnumberofcomments+"'&gt;\n&lt;span class='"+evenorodd+" bottom-comment' id='commentborder"+newnumberofcomments+"'&gt;\n&lt;div class='avatarWrapper' id='avatarwrap"+newnumberofcomments+"'&gt;&lt;img src='images/avatars/"+avatar+"' class='avatar32' id='avatar"+newnumberofcomments+"'/&gt;&lt;/div&gt;\n&lt;span class='thecomment' id='thecomment"+newnumberofcomments+"'&gt;\n&lt;a href='#' class='userl' id='userl"+newnumberofcomments+"'&gt;"+user+"&lt;/a&gt;&amp;nbsp;"+el.elements['enter-comment'].value+"&lt;/span&gt;\n&lt;/span&gt;\n&lt;span class='delete-holder' id='delete-holder"+newnumberofcomments+"'&gt;\n&lt;span class='delete-comment' style='opacity: 0;' id='delete"+newnumberofcomments+"' lang='bottom' onclick='removecomment(0,\"1\",this.lang,\"even\",document.getElementById(\"nrofcomments\").innerHTML);'&gt;&amp;#x2716;&lt;/span&gt;\n&lt;/span&gt;\n&lt;/span&gt;\n&lt;/span&gt;\n");
            $(newcomment).css({visibility:"visible",display:"block",position:"absolute"});
            theHeight = $(theCommentID).height() + 2;
            if(theHeight &lt; 36){
                theHeight = 36;
            }
            $(newcomment).css({display:"none",position:"relative",visibility:"visible"});
            $(commentID).height(theHeight);
            $(commentBorderID).height(theHeight);
            $(newcomment).height(theHeight);
            $(newcomment).animate({height: 'show'},500);
            $("html, body").animate({ scrollTop: $(document).height() }, 500);

            //Flat out corners of last comment
            $(theLastID).removeClass("bottom-comment").addClass("middle-comment");
            $(deleteLast).attr("lang", "middle");

            //Reset texarea
            $("#enter-comment").fadeTo(500, 1).removeAttr("readonly").val("Write a comment...").css("color","#ccc");

            //Change the current number of comments and if the next one needs to be even or odd
            $("#nrofcomments").html(realnumberofcomments);
            if(evenorodd == "even"){
                $("#newevenorodd").html("odd");
            }else{
                $("#newevenorodd").html("even");
            }
        }
    }
}

query = 'enter-comment=' + el.elements['enter-comment'].value;

xmlhttp.open("POST","spotlight/comment.php?add=true",true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send(query);
}
</code></pre>
