Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback function #6

Open
mattcasey opened this issue Jan 14, 2013 · 2 comments
Open

callback function #6

mattcasey opened this issue Jan 14, 2013 · 2 comments

Comments

@mattcasey
Copy link

would be nice to have some way to call a function after typing is done. I edited 3 places, now I can set $.typer.options.OnDoneTyping before the typing begins
Line 14:

  var
    options = {
      highlightSpeed    : 20,
      typeSpeed         : 100,
      clearDelay        : 500,
      typeDelay         : 200,
      clearOnHighlight  : true,
      typerDataAttr     : 'data-typer-targets',
      typerInterval     : 2000,
      OnDoneTyping      : null
    },

Line 77:

    if (!text || text.length === 0) {
      clearData($e);
      onDoneTyping();
      return;
    }

Line 258:

  onDoneTyping = function () {
    if(typeof $.typer.options.OnDoneTyping == 'function') {
      $.typer.options.OnDoneTyping();
    }
  };
@bbirand
Copy link

bbirand commented Nov 9, 2014

Would be good to have this merged..

@KeeyaWangJones
Copy link

Hi, I am trying to allow the user to pause and play the typer so that it is not distracting to the other content on the website. I tried adding an option and calling it with your method. Tweaked with jQuery pause and play.

var options = {
      highlightSpeed    : 20,
      typeSpeed         : 100,
      clearDelay        : 500,
      typeDelay         : 200,
      clearOnHighlight  : true,
      typerDataAttr     : 'data-typer-targets',
      typerInterval     : 2000,
      OnDoneTyping      : null,
      PausePlayTyping: null
    },
 if (!text || text.length === 0) {
      clearData($e);
      PausePlayTyping();
      return;
    }
PausePlayTyping = function () {
      $('.typer').click(function() {
          if (this.paused == false) {
          this.pause();
          alert('typer paused');
       } else {
         this.play();
         alert('typer playing');
       }
     })
};

Or is there a pause/play toggle already built into the plugin?
If so, how do I call it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants