jquery play audio once
- Started
- Last post
- 3 Responses
- wwfc
hi...
i am stuck on something that is sooo near to working as i want it to...
i have a page that plays audio as you scroll from one div to another - the audio fades in / fades out depending on scoll position. it's working fine.
but.... i want each sound to play only once - not looping to the start of the sound as it is at the moment.i've tried a few things but to no avail - it just keeps looping :-(
anyone see or tell me how to say to the js to play the sound when the div is reached and then once it plays once - stop the sound - until the next time the div is visited?
here is my code:
i found this via https://forum.jquery.com/topic/j…
it is pretty much exactly what i want - but i don't want the sounds to keep looping while the div is active - just to play once per visit to the div
:-/
here's hoping...
- uan0
delete 'loop' from the audio tags
audio class="set1" id="soundTour3" src="1.mp3"></audio
instead of
audio loop class="set1" id="soundTour3" src="1.mp3"></audioidea out of a fast scroll through your pastebin code
- wwfc0
thanks uan... the loop thing was right - but it seems that it makes all of the mp3s play at once (one with volume up and the others with the volume at 0) - how do i say to wait until a certain div is loaded before it plays? :/
and ideaist... there are interesting things on that page :-)
- ...and nearly forgot!!! thanks both for the replies ;-)
wwfc
- ...and nearly forgot!!! thanks both for the replies ;-)