ForgeComponenti
it

Componenti

j-Typed

jComponent 20 · jcomponent@20 component Esempio caricato con jComponent 20

Configurazione:

Config è lo stesso di JSL'unica differenza è che tutte le chiavi sono inferiori.Questo è per mantenere la coerenza con gli altri componenti.L'unica configurazione aggiunta è id

  • NEW: selector {String} può contenere un elemento nido per renderare il testo
  • NEW: text {String} nel modulo Text 1|Text 2|Text 3|Text N altrimenti il testo è caricato secondo il path
  • typespeed {Number} in millisecondi (default: 0)
  • startdelay {Number} in millisecondi (default: 0)
  • backspeed {Number} in millisecondi (default: 0)
  • smartbackspace {Boolean} questo sarebbe solo dietro le parole dopo "Questo è un" (default: true)
  • shuffle {Boolean} schiuma le strisce (default: true)
  • backdelay {String} tempo prima del backspacing (default: 700)
  • fadeout {Boolean} è uscito invece di backspace (default: false)
  • Classificazione di fadeoutclass {String} css per l'animazione fade (default: typed-fade-out)
  • fadeoutdelay {Number} ritarda in millisecondi (default: 500)
  • Strisce di loop loop {Boolean} (default: false)
  • loopcount {String/Number} Quantità di spuntini (default) Infinity)
  • Il cursore di visualizzazione showcursor {Boolean} (default: true)
  • Il carattere del cursore cursorchar {String} (default: |)
  • autoinsertcss {Boolean} inserisce CSS per il cursore e fadeOut in HTML <head> (default: true)
  • Contenuto contenttype {String}Tippo html o null per il reclamo (default: html)

Eventi globali:

Ancora una volta, come di JSAggiunto component Parametri

  • ON('typed.onComplete', function(typed, component) {})
  • ON('typed.preStringTyped', function(pos, typed, component) {})
  • ON('typed.onStringTyped', function(pos, typed, component) {})
  • ON('typed.onLastStringBackspaced', function(typed, component) {})
  • ON('typed.onTypingPaused', function(pos, typed, component) {})
  • ON('typed.onTypingResumed', function(pos, typed, component) {})
  • ON('typed.onReset', function(typed, component) {})
  • ON('typed.onStop', function(pos, typed, component) {})
  • ON('typed.onStart', function(pos, typed, component) {})
  • ON('typed.onDestroy', function(typed, component) {})

Utilizzare con <ui-component name="typed">Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo DEF.fallback (Il Componentator La storia di Denis Granec. fonte: il Componentator Ristorante dei componenti, licenza MIT.

example.html
<div style="height:100px">
	<ui-component name="typed" path="messages" config="loop:true" style="white-space:pre"></ui-component>
</div>
<div style="height:50px">
	<ui-component name="typed" path="messages2" config="loop:true;typespeed:100;backspeed:50"></ui-component>
</div>

<script>
	var messages = 'npm install total.js^1000\n`+ <b>total.js@3.1.0</b>` ^1000\n`added <b>1 package</b> from 23 contributors and audited 1 package in <b>1.348s</b>` ^1000\n`found 0 vulnerabilities`';
	var messages2 = ['Hello world!', '<b>Total.js</b> is awesome!', 'jComponent is <b>awesome</b>!', 'Lorem ipsum', 'Lorem dolor'];

	var count = 0;
	ON('typed.onComplete', function(typed, component) {
		if (typed.el.id === 'myconsole') {
			count++;

			if (count === 5)
				typed.loop = false;
		}
	});
</script>