kittykatattack / sound.js

A micro-library to load, play and generate sound effects and music for games and interactive applications
300 stars 44 forks source link

How to Call sounds via a href / button and not keyboard? #25

Open webdesignleader opened 5 years ago

webdesignleader commented 5 years ago

Hi there,

I understand the basics of using the sound.js functionality but I'm having trouble calling the play functions without using a keyboard reference. Is there an onClick function built into this or an easy work around?

ig. <a onclick="music.play();"><button>Start the Music bro!</button></a>

Super excited to get going with this. There's less latency on this script than others I've seen. Very thankful to the developer.

Thank you! Abraham