INNER CODE UNIT · JavaScript
shiftPresentCharacters
vasani-arpit/Social-Media-Automation · libs/numberAnimate.js:337
var shiftPresentCharacters = function () {
var shiftTime = animationTimes[1];
pos = Math.min(largestRequiredPos, largestCurrentPos);
var endPos = Math.max(smallestRequiredPos, smallestCurrentPos);
index = indexOfPoint - pos;
for (; pos >= endPos; pos--, index++) {
character = newValue.charAt(index);
var holdingDiv = $this.find("[data-numberAnimate-pos=" + pos + "]");
shiftToChar(holdingDiv, character, shiftTime);
}
};
//execute above function straight away or once the newly created holding div has finished animating..
if (newlyCreatedHoldingDiv) {
bindToTransitionEndForSingleRun(
$(newlyCreatedHoldingDiv), shiftPresentCharacters, animationTimes[0] + 100);
} else {
shiftPresentCharacters();