- var imgSize = $("#imagescroll ul li").size();
- var divSize = $("#imagescroll").width();
- var imgTotal = divSize * imgSize
-
- $("#imagescroll div b").html(imgSize);
- $("#imagescroll").width(imgTotal);
-
- $(".scroll").click(
- function() {
- $(this).removeClass("scroll");
- $(this).animate({ marginLeft: '-='+divSize }, "slow" );
- }
- );
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?