Javascript display image on audio current time -


im beginner in javascript , im stuck @ problem. when click play function play() shows if <= 2.5 not when > 2.5 .(i displayed 'reddot' in html display hidden).

function play() {      var audio = document.getelementbyid("audio");     audio.play();     if (audio.currenttime <= 2.5) {         document.getelementbyid('reddot').style.display = 'block';     }     if (audio.currenttime > 2.5) {         document.getelementbyid('reddot').style.display = 'none';         document.getelementbyid('reddot2').style.display = 'block';     }  }  function () {  }  function pause(){     var audio = document.getelementbyid("audio");     audio.pause();   } function load(){     var audio = document.getelementbyid("audio");     audio.pause();     audio.currenttime = 0;  }  function rewind() {     var audio = document.getelementbyid("audio");     audio.play();     audio.currenttime = (audio.currenttime-6); } 


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -