INNER CODE UNIT · JavaScript
shiftToChar
vasani-arpit/Social-Media-Automation · libs/numberAnimate.js:94
var shiftToChar = function ($holderDiv, character, shiftTime) {
var innerStyle = $holderDiv.children()[0].style;
innerStyle[css3Prefix + 'Transition'] = "all " + shiftTime + "ms ease-in-out";
var indexOfChar = allChars.indexOf(character);
var transformY;
if (indexOfChar < 0 || /\s/.test(character)) {
transformY = $holderDiv.height();
} else {
transformY = 0 - (indexOfChar / 2) * $holderDiv.height();
}
innerStyle[css3Prefix + 'Transform'] = translateOpen + transformY + translateClose;
};
//Function to create a new character wrapper div to wrap the given character
//setting the holding div to have the given dimension and given "position".
//You should attach the element returned by this function to the DOM straight
//away in order for the animation to take effect..