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

244
Visualizações
Play Video by trigger('play') for 1
 $('a.thumbnail').click(function(){ 
  $(this).('.cu_vd').trigger('play');
}); 

 $('a.thumbnail').click(function(){ 
      $(this).('.cu_vd').trigger('play');
    }); 

I am trying to play the video by trigger but the video boxes are multiple with the same class. So I am trying to use 'this' so that It does not trigger to all, but it's not working This is the HTML page, where I am trying to play the video

https://dev-visualshowcase.cvent.com/bkeventvideos.html click on the IOV 1 (First box) the pop-up triggers and I want to play this video with JS function, instead of autoplay, because autoplay is not supporting in IOS https://dev-visualshowcase.cvent.com/eventvideos.html - here you can check the problem

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use the data-attribute to target a specific video

<button class="thumbnail" data-target="video_1">Play the video</button>

<video id="video_1" playsinline="" preload="auto" muted="" controls="" loop="">
  <source src="https://dev-visualshowcase.cvent.com/VS/video/vd_intro/01.mp4" type="video/mp4">
</video>

Each time you click on the .thumbnail button, you use the data-target to choose your video

 $('.thumbnail').click(function(){ 
   let target = $(this).attr('data-target')
   $('#' + target).trigger('play');
 });  
about 4 years ago · Juan Pablo Isaza Relatório
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