javascript - How to display different content on callback iteration in JS -


let me start of saying unfamiliar js. of work done in ruby.

i running typed.js on home page iterate through 3 messages. per documentation, library provides it's own callback triggers. using "prestringtyped" trigger fired before each string typed.

what i'm trying display different image each message. how display different image each message? expecting possibly sort of counter ( if i==1 etc.) said js skills not good.

the typed.js library supports index parameter in callback need initialize this:

$(".element").typed({   //... other options   callback: function(index) {     if (index === 0) {       //etc...     }   } }); 

Comments