Skip to content

Commit

Permalink
edits based on solution by russelcole at bfintal#28 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
onepartscissors committed Feb 25, 2016
1 parent 20207e2 commit 90bc341
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jquery.counterup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@
// Store the object
var $this = $(this);
var $settings = settings;
var $originalText = $this.text();
// added this line based on solution by russelcole
// https://github.com/bfintal/Counter-Up/issues/28#issue-132097963

var counterUpper = function() {
var nums = [];
var divisions = $settings.time / $settings.delay;
var num = $this.text();
var num = $originalText;
// added this line based on solution by russelcole
// https://github.com/bfintal/Counter-Up/issues/28#issue-132097963

var isComma = /[0-9]+,[0-9]+/.test(num);
num = num.replace(/,/g, '');
var isInt = /^[0-9]+$/.test(num);
Expand Down Expand Up @@ -80,4 +87,4 @@

};

})( jQuery );
})( jQuery );

0 comments on commit 90bc341

Please sign in to comment.