1/*********** 2 Animates element's number to new number with commas 3 Parameters: 4 stop (number): number to stop on 5 commas (boolean): turn commas on/off (default is true) 6 duration (number): how long in ms (default is 1000) 7 ease (string): type of easing (default is "swing", others are avaiable from jQuery's easing plugin 8 Examples: 9 $("#div").animateNumbers(1234, false, 500, "linear"); // half second linear without commas 10 $("#div").animateNumbers(1234, true, 2000); // two second swing with commas 11 $("#div").animateNumbers(4321); // one second swing with commas 12 This fully expects an element containing an integer 13 If the number is within copy then separate it with a span and target the span 14 Inserts and accounts for commas during animation by default 15***********/ 16 17(function($) { 18 $.fn.animateNumbers = function(stop, commas, duration, ease) { 19 return this.each(function() { 20 var $this = $(this); 21 var start = parseInt($this.text().replace(/,/g, "")); 22 commas = (commas === undefined) ? true : commas; 23 $({value: start}).animate({value: stop}, { 24 duration: duration == undefined ? 1000 : duration, 25 easing: ease == undefined ? "swing" : ease, 26 step: function() { 27 $this.text(Math.floor(this.value)); 28 if (commas) { $this.text($this.text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")); } 29 }, 30 complete: function() { 31 if (parseInt($this.text()) !== stop) { 32 $this.text(stop); 33 if (commas) { $this.text($this.text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")); } 34 } 35 } 36 }); 37 }); 38 }; 39})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.