Landing no longer executed a JS doc that at first had executed
In the landing page that I am developing with some effects, today add a script to make the "typeEffect" in the third title of this landing, which added a unique class to this title so that they will only execute it in that and not others (attached screenshot of the mentioned).
This class (.gg) that was added in the module of the title is sent to call in the document of JS for the typeEffect only execute in this title (my title of the mentioned thing).
At the beginning if I execute it well but then I no longer execute it. I do not know what could have happened.
I have a question about how to send what you tell me to call. It is correct to put it this way:
In this form is correct:
function typeEffect() { var text = $('.gg').find('h3').find('span').text(); $('.gg').find('h3').find('span').text().html('');
var i = 0; var timer = setInterval(function() { if (i < text.length) { $('.gg').find('h3').find('span').text().append(text.charAt(i)); i++; } else { clearInterval(timer); } }, speed); }
function typeEffect(element, speed) { var text = $(element).text(); $(element).html('');
var i = 0; var timer = setInterval(function() { if (i < text.length) { $(element).append(text.charAt(i)); i++; } else { clearInterval(timer); } }, speed); }