Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
show floating audio controller hover when the audio file is playing

I'm using a java script to allow playing audio when text is click the second click start the audio file selected by the div, and the second click pause it.

all the audio files are loaded without controller with a specific div class

let isClicked = false;

function playclip1() {
  if ((navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.indexOf('MSIE 7') != -1) || navigator.appVersion.indexOf('MSIE 8') != -1) {
    if (document.all) document.all.sound.src = 'click.mp3';
  } else {
    let audio = document.getElementById('audiop1');
    if (!isClicked) audio.play();
    else audio.pause();

    isClicked = !isClicked;
  }
}
<a href="javascript:playclip1();">Click For Sound</a><br>

<audio id="audiop1">
<source src="audio.wav" type="audio/wav">
</audio>

I want that controller will float in the top right for all audio files and will show only the audio controller of the div that is currently playing if there is no audio playing it will not show any controller in the selected location or, optional will show the last audio file played.

I have multiply functions playclip1 > audiop1 playclip2 > audiop2 and so on

thank you.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda