Unexpected Behaviour

Unexpected Behaviour

  1. var imgSize = $("#imagescroll ul li").size();
  2. var divSize = $("#imagescroll").width();
  3. var imgTotal = divSize * imgSize
  4. $("#imagescroll div b").html(imgSize);
  5. $("#imagescroll").width(imgTotal);
  6. $(".scroll").click(
  7. function() {
  8. $(this).removeClass("scroll");
  9. $(this).animate({ marginLeft: '-='+divSize }, "slow" );
  10. }
  11. );
My problem is, when the click function removes the class .scroll, it still scrolls even though it shouldn't able to locate the class that it should be applying the animation to? 

Anyone know why? is this a glitch?