Skip to content
Browse files

Merge pull request #3 from philipbjorge/master

Made text trimming optional
  • Loading branch information...
2 parents 6907c30 + 293b80a commit 76003146b45629a92187a95523aede5651c3f938 @chadselph committed
Showing with 4 additions and 1 deletion.
  1. +1 −0 README
  2. +3 −1 jquerytypewriter.js
View
1 README
@@ -12,5 +12,6 @@ In general, it's like this:
$('.someselector').typewrite({
'delay': 100, //time in ms between each letter
'extra_char': '', //"cursor" character to append after each display
+ 'trim': true, // Trim the string to type (Default: false, does not trim)
'callback': null // if exists, called after all effects have finished
});
View
4 jquerytypewriter.js
@@ -15,6 +15,7 @@
'selector': this,
'extra_char': '',
'delay': 100,
+ 'trim': false,
'callback': null
};
if (options) $.extend(settings, options);
@@ -24,7 +25,8 @@
* of all at the same time. */
function type_next_element(index) {
var current_element = $(settings.selector[index]);
- var final_text = $.trim(current_element.text());
+ var final_text = current_element.text();
+ if (settings.trim) final_text = $.trim(final_text);
current_element.html("").show();
function type_next_character(element, i) {

0 comments on commit 7600314

Please sign in to comment.
Something went wrong with that request. Please try again.