diff --git a/README.md b/README.md index 3be0145..2b4d069 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ There are some options that are available to you as well: typeDelay : 200, clearOnHighlight : true, typerDataAttr : 'data-typer-targets', - typerInterval : 2000 + typerInterval : 2000, + tapeColor : 'auto' // 'auto' or a css color value } ``` diff --git a/src/jquery.typer.js b/src/jquery.typer.js index 9c59e25..8482796 100644 --- a/src/jquery.typer.js +++ b/src/jquery.typer.js @@ -19,7 +19,8 @@ String.prototype.rightChars = function(n){ typeDelay : 200, clearOnHighlight : true, typerDataAttr : 'data-typer-targets', - typerInterval : 2000 + typerInterval : 2000, + tapeColor : 'auto' }, highlight, clearText, @@ -130,7 +131,7 @@ String.prototype.rightChars = function(n){ .append( spanWithColor( $e.data('backgroundColor'), - $e.data('primaryColor') + $.typer.options.tapeColor === 'auto' ? $e.data('primaryColor') : $.typer.options.tapeColor ) .append(highlightedText) ) @@ -224,7 +225,7 @@ String.prototype.rightChars = function(n){ $e.data('oldRight', currentText.rightChars(j - 1)); $e.data('leftStop', i); $e.data('rightStop', currentText.length - j); - $e.data('primaryColor', $e.css('color')); + $e.data('primaryColor', $.typer.options.tapeColor === 'auto' ? $e.data('primaryColor') : $.typer.options.tapeColor); $e.data('backgroundColor', $e.css('background-color')); $e.data('text', newString); highlight($e); diff --git a/test.html b/test.html index a9311f0..1cf9fc3 100644 --- a/test.html +++ b/test.html @@ -2,8 +2,12 @@
- - + + +