Giter Club home page Giter Club logo

Comments (8)

tameemsafi avatar tameemsafi commented on June 18, 2024

@calebarchie Please see the fiddle with link below. You will need to create a variable to store the typewriter instance. That way when mouse enters, you can create the instance and assign the it to the variable. Then once mouse leaves, you can stop the typewriter animation and clear the variable and contents.

https://jsfiddle.net/yp32rosa/

from typewriterjs.

calebarchie avatar calebarchie commented on June 18, 2024

Hi, I think I understand however I am having a little difficulty working it into the project with my limited knowledge.

Basically, I'd like the typewriter to function normally on load then on mouseover (on a logo next to typewriter div) write a string THEN on mouseout restart the original typewriter function on load. It is just a contact button, see website here:
https://www.thecontainerlab.com/
p/w = arcifa

I think my problems stem from the process to clear the variable:
typewriterElement.innerHTML = '' "

Whereas I'd like to to restart, I have modified it so that is will function but it just keeps creating extra divs on each event. I think what I need is an event to remove div then make new one. Sorry these dynamic divs are new to me and confusing.

from typewriterjs.

tameemsafi avatar tameemsafi commented on June 18, 2024

@calebarchie Please look at the fiddle link below and let me know if that helps you.

https://jsfiddle.net/cxvugsry/

from typewriterjs.

calebarchie avatar calebarchie commented on June 18, 2024

Thanks! I think that is something I can work with, this is as far as I got with the other code:
https://www.dropbox.com/s/jv0n2oyevxigqxw/the-container-lab.zip?dl=0

I'll have a fiddle with the new one and let you know how I go.

from typewriterjs.

calebarchie avatar calebarchie commented on June 18, 2024

OK I got it working however something with the fiddle I noticed the originalTypewriter won't actually loop in the fiddle despite being set to loop?

It would be good to combine the one I posted and the fiddle eg; rather than just hide/show those two typewriters, fire originalTypewriter from first string on mouseout instead. I really do need to learn JS properly at some point.

Thanks again!

from typewriterjs.

tameemsafi avatar tameemsafi commented on June 18, 2024

@calebarchie np, good to hear.

from typewriterjs.

calebarchie avatar calebarchie commented on June 18, 2024

OK I must be going mad as I seem to be going in circles. The pause() does not seem to work for me? Only works if I change it to a stop() which is not really what I'm after.

Could this be because, for some reason I am using the first version of the script?

from typewriterjs.

calebarchie avatar calebarchie commented on June 18, 2024

Updated to latest version, working fine. Can't see how to change cursor blink speed and keep write/delete speed speed the same like in V1.

from typewriterjs.

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.