Biblioteca de rotación de texto estilo Typewriter-mecanógrafa
| Autor: | positionly |
|---|---|
| Views Total: | 2,427 |
| Sitio oficial: | Ir a la web |
| Actualizado: | July 11, 2016 |
| Licencia: | MIT |
Vista prévia
Descripción
Typist es una biblioteca JavaScript simple, flexible y independiente del marco de trabajo que se utiliza para rotar a través de una lista de texto con una animación de escritura personalizable.
Funcionamiento
Agregue el archivo JavaScript Typist a su página HTML.
<script src="dist/typist.js"></script>
Envuelva el texto separado con una coma en un elemento alineado como fuerte.
I Love <strong id="typist-element" data-typist="AngularJS,ReactJS,Vue.js">JavaScript</strong>
Inicialice el Typist con varias opciones.
var typist;
typist = document.querySelector('#typist-element');
new Typist(typist, {
letterInterval: 60,
textInterval: 3000
}); Estilo del texto seleccionado.
.selectedText {
background: #f00;
} Más opciones de configuración:
new Typist(typist, {
// Miliseconds between typing a letter
letterInterval: 60,
// Miliseconds between text rotation
textInterval: 3000,
// Select element class name
selectClassName: 'selectedText',
// Callback when the slide changes, returns two arguments `text` (current textvariation) and `option` (an object of variables that might be of use, like the `slideIndex` or the typist element itself)
onSlide: null
});





