Is there an easy way to slow down the iteration in a forEach (with plain javascript)? For example:  var items = document.querySelector('.item');  items.forEach(function(el) {   // do stuff with el and pause before the next el; });...
I have a html file that contains a video. I want to add a feature to pause video when the window is minimized or the tab is changed on browser.  How can add that feature to my html?  I added javascript function but video is still being played in any...
I'm currently working on an image slideshow with 5 buttons (Start, stop, pause, backwards, forwards) My start button loads an autoRun function which starts to play through the images while the backwards/forwards buttons skip/go back an image. I&#...
I am making a js game with a pause button. The button works fine, however if my mouse enters the button, leaves, and then clicks, the effect is triggered. Here is my code:      document.onmousemove=function(mouse){     mouseX=mouse.clientX-8;     mou...
Found an infinite horizontal carousel I like but need to find an alternative to animation-play-state (not working on iOS) for pause on hover. I'm not familiar enough with JavaScript to piece together other resources I've found, so I'd rea...
I'm new to JavaScript and am having trouble using the .play() and .pause() functions. I've looked this up online but can't find many answers and any that do appear don't seem to help.  HTML  <audio src="audiofile.mp3" id=&#...
I got a project that has a video that plays in a loop. Here is the html for the video tag:    <video playsinline autoplay muted loop id="myVid">       <source src="River.mp4" type="video/mp4">   </video>   I...
Can anyone tell me why I'm not being able to pause the loop? The idea is to pause it for 5 seconds and then restart it. The code is bellow. Thanks!  let pics = [{         name: 'picture',         picture: 'https://images.unsplash.com/...
So I have code that looks like this. I press the button and an mp3 plays. But I can't seem to find a way to make a stop button for this and was hoping y'all could help me.  <a href="#/" id="song1" class="buttons">...
I have a javascript game and it gives alert "Game Over!" when the game over condition is met, which is a distance being greater than another distance. The distance grows more and more so the condition is met again and again and the browser as...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.