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

129
Views
¿Cómo puedo pausar o detener el audio en este script de trabajo?

Este es un script de trabajo para comenzar a reproducir el audio deseado. ¿Alguien podría decir una buena solución para pausar o detener el audio haciendo clic nuevamente en el párrafo onclick?

 <!DOCTYPE html> <html lang="hu"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=script, initial-scale=sript"> <title>English Homonyms</title> <link rel="stylesheet" href="css/style.css"> <script type="text/javascript"> function play(param) { const playlist = [ "0 => nincs", "audio/audio_01.mp3", "audio/audio_02.mp3", "audio/audio_03.mp3" ]; var list = param; var music = playlist[param]; var audio = new Audio(music); audio.play(); } </script> </head> <body> <h1>ENGLISH PRONUNCIATON NONSENSES – HOMONYMS</h1> <p onclick = "play(1)">1. The bandage was wound around the wound.</p> <p onclick = "play(2)">2. The farm was used to produce produce.</p> <p onclick = "play(3)">3. The dump was so full that it had to refuse more refuse.</p> </body> </html>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

let nowPlaying = 0 let nowAudio = new Audio() function play(param) { const playlist = [ "0 => nincs", "audio/audio_01.mp3", "audio/audio_02.mp3", "audio/audio_03.mp3", ]; var lista = param; var zene = playlist[param]; if (nowPlaying === param) { if (nowAudio.paused) { nowAudio.play() } else { nowAudio.pause() } } else { nowAudio = new Audio(zene); nowAudio.play(); nowPlaying = param } }
about 4 years ago · Juan Pablo Isaza Report
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!