html5 - changing image in start and pause player javascript -



html5 - changing image in start and pause player javascript -

i have code works great starting , pausing sound html5 player , looks this

i want insert img of player alter on every click , wrote this

<script> function aud_play_pause4() { var myaudio = document.getelementbyid("myaudio4"); if (myaudio.paused) { myaudio.play(); } else { myaudio.pause(); } } </script> <script> function aud_play_pause5() { var myaudio = document.getelementbyid("myaudio5"); if (myaudio.paused && document.getelementbyid("btn").src == "btnpause.png") { myaudio.play(); document.getelementbyid("btn").src = "btn.png"; } else { myaudio.pause(); document.getelementbyid("btn").src = "btnpause.png"; } } </script>

this 5th track id

im checking log nil wrong code saw changes first track id , not fifth

192.185.121.126/~vagabond/coral/ link

your ids must specific each button (img)... have "btn" id buttons (img).

so, when phone call document.getelementbyid("btn") getting first img (button).

javascript html5

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -