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

126
Vistas
Video size resets momentarily when changing src

When I change the src of a video, it momentarily shrinks to its default size and scrolls the screen up, but once it loads, the screen doesn't go back down. How can I prevent the resetting of the video, and make it so it does not scroll up? Here's the code:

      <div class="leftArrow">
        <a aria-label="Previous Video" class="lArrow" onclick=lastVideo()><img src="source/leftArrow.png" class="arrow"></a>
      </div>
      <div class="video" >
        <video src="video.mp4" id="video" controls autoplay>Video not supported</video>
      </div>
      <div class="rightArrow">
        <a aria-label="Next Video" class="rArrow" onclick=nextVideo()><img src="source/rightArrow.png" class="arrow"></a>
      </div>
    </div>
    var title = document.getElementById("title");
    title.innerHTML = titleList[currentVideo];

    var desc = document.getElementById("desc");
    desc.innerHTML = descList[currentVideo];

    var video = document.getElementById("video");
    video.src = aList[currentVideo]; 
    
    video.load();
    video.play();
    return;
}

function nextVideo() {
    if (currentVideo == aList.length - 1) {
        currentVideo = -1;
    }
    currentVideo++;
    loadVideo();
}

function lastVideo() {
    if (currentVideo == 0) {
        currentVideo = aList.length;
    }
    currentVideo--;
    loadVideo();
}
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