2015 Note: . Everyone should look at old questions and be encouraged by how far they have come. There are so many errors in this code - this is great.
This code works PERFECTLY in Firefox, and in IE the line ends with "negative"); breaks. I have no idea how to fix this! Argghhh!
$(".topline strong").digits().each(function () {
s = $(this),
c = "change";
if ($(s).hasClass(c) & $(s).text().replace(/%/gi, "") > 0) {
$(s).addClass("positive");
}
if ($(s).hasClass(c) & $(s).text().trim().charAt(0) == "-") $(s).addClass("negative");
});
source
share