Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda