Skip to content

Commit

Permalink
don't split words into characters if type is char
Browse files Browse the repository at this point in the history
  • Loading branch information
nawafnaim committed Dec 16, 2014
1 parent 5c1bf1c commit 0e59238
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions jquery.textillate.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,19 @@
.text($elem.html())
.lettering('words');

base.$current.find('[class^="word"]')
.css({
'display': 'inline-block',
// fix for poor ios performance
'-webkit-transform': 'translate3d(0,0,0)',
'-moz-transform': 'translate3d(0,0,0)',
'-o-transform': 'translate3d(0,0,0)',
'transform': 'translate3d(0,0,0)'
})
.each(function () { $(this).lettering() });
// split words to individual characters if token type is set to 'char'
if (base.type == "char") {
base.$current.find('[class^="word"]')
.css({
'display': 'inline-block',
// fix for poor ios performance
'-webkit-transform': 'translate3d(0,0,0)',
'-moz-transform': 'translate3d(0,0,0)',
'-o-transform': 'translate3d(0,0,0)',
'transform': 'translate3d(0,0,0)'
})
.each(function () { $(this).lettering() });
}

$tokens = base.$current
.find('[class^="' + base.options.type + '"]')
Expand All @@ -176,7 +179,7 @@

base.currentIndex = index;

animateChars($tokens, options.in, function () {
animateTokens($tokens, options.in, function () {
base.triggerEvent('inAnimationEnd');
if (options.in.callback) options.in.callback();
if (cb) cb(base);
Expand All @@ -190,7 +193,7 @@

base.triggerEvent('outAnimationBegin');

animateChars($tokens, options.out, function () {
animateTokens($tokens, options.out, function () {
$elem.removeClass('current');
base.triggerEvent('outAnimationEnd');
if (options.out.callback) options.out.callback();
Expand Down

0 comments on commit 0e59238

Please sign in to comment.