Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ There are some options that are available to you as well:
typeDelay : 200,
clearOnHighlight : true,
typerDataAttr : 'data-typer-targets',
typerInterval : 2000
typerInterval : 2000,
highlightColor : null, // set to null if not customized
textColor : null, // set to null if not customized
initialDelay : 1000
}
```

Expand Down
16 changes: 11 additions & 5 deletions src/jquery.typer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ String.prototype.rightChars = function(n){
typeDelay : 200,
clearOnHighlight : true,
typerDataAttr : 'data-typer-targets',
typerInterval : 2000
typerInterval : 2000,
highlightColor : null, // set to null if not customized
textColor : null, // set to null if not customized
initialDelay : 1000
},
highlight,
clearText,
Expand Down Expand Up @@ -226,14 +229,17 @@ String.prototype.rightChars = function(n){
oldRight: currentText.rightChars(j - 1),
leftStop: i,
rightStop: currentText.length - j,
primaryColor: $e.css('color'),
backgroundColor: $e.css('background-color'),
primaryColor: $.typer.options.highlightColor || $e.css('color'),
backgroundColor: $.typer.options.textColor || $e.css('background-color'),
text: newString
});

highlight($e);
var initDelay = function() {
highlight($e);
return $e;
}
window.setTimeout(initDelay, $.typer.options.initialDelay)

return $e;
};

//-- Helper methods. These can one day be customized further to include things like ranges of delays.
Expand Down