CMS Development

Janette
Participante

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).

clase_unica_para_efecto.PNG

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).

clase_unica_para_efecto_en_JS.PNG

At the beginning if I execute it well but then I no longer execute it. I do not know what could have happened.

This script was add in the heder of my template:

script_encabezado_clase_unica_js.PNG

 

Do you think any other style has interfered?

You can help validate this plis.

I add link of the page: https: //www.inbest.cloud/desarrollo-en-la-nube

and template link: https://app.hubspot.com/design-manager/491090/templates/5934778072 I remain attentive to your comments.

 

I remain to your comments.

Thanks and Regards.

 

 

4 Respuestas 4
tjoyce
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Landing no longer executed a JS doc that at first had executed

@Janette

.gg is the parent container of the h3, not the h3 itself.

You want to call it like this:

$('.gg').find('h3').find('span').text();

gg.png


If this answer helped, please, mark as solved 😄


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

 

Drop by and say Hi to me on slack.

0 Me gusta
Janette
Participante

Landing no longer executed a JS doc that at first had executed

@tjoyce Hi Good Day

 

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);
}

$( document ).ready(function() {
typeEffect($('.gg').find('h3').find('span').text(), speed);
setTimeout(function(){
}, delay);
});

 

or this for:

 

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);
}

$( document ).ready(function() {
var speed = 75;
var delay = $('.gg').find('h3').find('span').text().length * speed + speed;
typeEffect($('.gg').find('h3').find('span'), speed);
setTimeout(function(){
}, delay);
});

 

because I try with both but none of the 2 forms works.

 

I remain to your comments.

Regards

 

Es correcto?

 

0 Me gusta
tjoyce
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Landing no longer executed a JS doc that at first had executed

@Janette - I see it working in my chrome browser. Perhaps, do a hard refresh in case the javascript is cached?

0 Me gusta
Janette
Participante

Landing no longer executed a JS doc that at first had executed

@tjoyce this title "

¿CUÁL ES LA DIFERENCIA CON UN SERVIDOR EN TU SITE?

have you see with type effect?

I have already deleted my chache but I can see this title work with typeEffect.

 

I remain to your comments.

Regards

 

"