Code Monkey home page Code Monkey logo

Comments (2)

alexmacarthur avatar alexmacarthur commented on May 19, 2024

Hi, Geoff --

Sorry for the troubles you're having with this. The callback only executes if the loop option is set to false, since it was only designed to execute after all of the strings have been finally typed. I may consider releasing a patch to have that execute after each set of strings, though.

Additionally, when re-looping over the strings, TypeIt won't look at the strings option again; it will just re-use what's already been cached. So, to get your effect going, I'd construct the strings before passing them into TypeIt, like this:

var words = ["developer", "designer", "problem solver", "hard worker", "nice guy!"];
var sentences = [];

for(var i = 0; i < words.length; i++) {
    sentences.push('I&rsquo;m Geoff and I&rsquo;m a ' + words[i]);
}

$("#about h3").typeIt({
strings: sentences,
startDelay: 1500,
speed: 100,
loop: true,
autoStart: false
});

This will type out all of those strings, and because loop is set to true, delete the entire set (unless breakLines = false) and retype them.

I hope this helps! Let me know if you have more questions.

Alex

from typeit.

GeoffNeal avatar GeoffNeal commented on May 19, 2024

Hi Alex

Thanks for the response.

Yeah that should do the trick, I'll keep an eye out for your patch if you do one though.

Geoff

from typeit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.