My script is working perfectly only with html, but when I export to wordpress it doesn't work and this appears I would like to know some way to request it, I'm a beginner in javascript, but I'm trying to apply the writing effect but it doesn't work:
<span class="js-typedjs"
data-hs-typed-options='{
"strings": ["de você.", "da sua família."],
"typeSpeed": 90,
"loop": true,
"backSpeed": 30,
"backDelay": 2500
}'></span>
This one doesn't work either:
<script>
(function() {
// INITIALIZATION OF MEGA MENU
// =======================================================
const megaMenu = new HSMegaMenu('.js-mega-menu', {
desktop: {
position: 'left'
}
});
// INITIALIZATION OF SHOW ANIMATIONS
// =======================================================
new HSShowAnimation('.js-animation-link')
// INITIALIZATION OF BOOTSTRAP VALIDATION
// =======================================================
HSBsValidation.init('.js-validate', {
onSubmit: data => {
data.event.preventDefault()
alert('Submited')
}
})
// INITIALIZATION OF GO TO
// =======================================================
new HSGoTo('.js-go-to')
// INITIALIZATION OF NAV SCROLLER
// =======================================================
new HsNavScroller('.js-nav-scroller')
// INITIALIZATION OF TEXT ANIMATION (TYPING)
// =======================================================
const typed = HSCore.components.HSTyped.init('.js-typedjs')
})()
</script>
If you don't use the animation effect, you can remove this part or the "js-animation-link" class from your HTML:
// INITIALIZATION OF SHOW ANIMATIONS
// =======================================================
new HSShowAnimation('.js-animation-link')
If you do use the CSS class "js-animation-link", you need to add the element as "targetSelector" in the options, for example:
<a class="js-animation-link" href="javascript:;" role="button"
data-hs-show-animation-options='{
"targetSelector": "#signupModalFormLogin",
"groupName": "idForm"
}'>Log in here</a>
Or, in this documentation they use data-target: https://htmlstream.com/preview/front-v2.9.2/documentation/hs-libraries/show-animation.html#how-to-use
<a class="js-animation-link btn btn-sm btn-outline-secondary btn-sm-wide active" href="javascript:;"
data-target="#firstContent"
data-link-group="groups"
data-animation-in="slideInUp">First content</a>