Auto start audio when scrolling to the desired block. How to do?

When the user scrolls to a certain unit should start playing the audio file.
July 2nd 19 at 17:02
1 answer
July 2nd 19 at 17:04
I did:
the <script>
var myaudio = $("#audio")[0];
 $("#myshot a")
 .mouseenter(function() {
myaudio.play();
});
</script>


<audio id="audio" preload="auto">
 <source src="2.ogg">
 <source src="2.aac">
 <source src="2.mp3">
</audio>
Well, for example specify the link id: id="myshot"


Well, whatever you're comfortable with css editing. That is, if when you hover over the block. And for the scroll, probably you will waypoint.js library to use.

Find more questions by tags HTMLJavaScript