Skip to content

lucasfontesgaspareto/typing.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypingJS v0.3.0

A lightweight lib for typing effect in front-end

How to use

<body>
  <h1 data-text="TypingJS"></h1>
  <p data-text="A lightweight lib for typing effect in front-end"></p>
  <footer>Footer async - 2017</footer>

  <script src="typing-0.3.0.min.js" charset="utf-8"></script>
  <script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function() {
      var title = document.querySelector('h1'),
          paragraph = document.querySelector('p'),
          footer = document.querySelector('footer');

      var typingjs = new TypingJS();

      typingjs(title, {
        sync: true
      });
      typingjs(paragraph, {
        sync: true
      });
      typingjs(footer);
    });
  </script>
</body>