Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
¿Cómo usar la función de otro archivo JS?

Estoy tratando de usar la función bubble.js y hacer que la función de bubble.js se aplique a mi nuevo archivo js llamado archivo bubbleChanged.js

burbuja.js:

 let bubble = document.getElementById("speach-bubble"); let noDisplay; bubble.style.display ="none"; const delay = setTimeout(bubbleAnimate,1500) export function bubbleAnimate() { noDisplay = bubble.style.display ="block"; bubble.style.animation="slidein 1.6s 1"; }

bubbleChanged.js:

 import{bubbleAnimate} from '../js/bubble.js'; let form = document.querySelector('.form') form.addEventListener('submit' , (e) => { e.preventDefault(); const input = document.getElementById('input').value; let textChange= document.getElementById('speach-bubble'); textChange.innerHTML = "Welcome to your To-do app \n" + input; bubbleAnimate() }); bubbleAnimate() { textChnage.style.display ="block"; textChnage.style.animation="slidein 1.6s 1"; }

no estoy seguro de lo que estoy haciendo mal aquí? ¿Debería bubbleAnimate() estar dentro del detector de eventos?

En resumen, cuando la burbuja de diálogo se actualiza después de la entrada del usuario, la misma animación debe ocurrir cuando cambia la burbuja de diálogo.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!