Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript typewriter effect

// this function performs a typewriter effect on an element from the HTML DOM
function TypeWriter(target, text, delay, clearText = false) {
	if (target.textContent === text) {
		return;
	}
	if (clearText) {
		target.textContent = "";
	}
	let _delay = 0;
	for (let i = 0; i < text.length; i++) {
		_delay += delay;
		window.setTimeout(function() {
			target.textContent += text[i];
		}, _delay);
	}
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: jsx style styling 
Javascript :: js delete json element 
Javascript :: rails to json 
Javascript :: js returns the number of true values there are in an array 
Javascript :: flatten 2d array javascript 
Javascript :: vuejs router params 
Javascript :: api.fetch saga 
Javascript :: combine 2 arrays javascript 
Javascript :: refresh modal on button click jquery 
Javascript :: javascript data types 
Javascript :: javascript find object array 
Javascript :: javascript particles js not working 
Javascript :: reload datatable without ajax 
Javascript :: Configure the Chrome debugger react 
Javascript :: innertext of element js 
Javascript :: redux dev tool 
Javascript :: How to Submit Forms and Save Data with React.js 
Javascript :: vuejs does props factory function have access to vue instance 
Javascript :: this.handler.handle is not a function 
Javascript :: jsx inline style 
Javascript :: convert camelCase letter to Sentence case 
Javascript :: format to precision 2 javascript if double 
Javascript :: how to write a comment in react js 
Javascript :: the sum of all first n natural numbers js 
Javascript :: update data using mongoose 
Javascript :: conditional props react 
Javascript :: jquery selector id ends with 
Javascript :: js local storage 
Javascript :: connected-react-router error could not find router reducer in state tree 
Javascript :: remove object from array by value javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =