sfombom Posted June 26, 2012 Report Share Posted June 26, 2012 Hello i have written some code and its works perfectly on google chrome, but i want to make it work on safari, opera, firefox, explorer. So what exactly this code does well it is powered by jquery and html. When you press key ,,a'' on a keyboard music start playing., but as i sed its only works on chrome, plis help me modify it so it would work on ff,opera,... Here the code: $(document).ready(function() { $(document).keyup(function(objEvent){ (objEvent) ? keycode=objEvent.keyCode : keycode = event.keyCode; if(keycode==65) { var audio = document.getElementById("hello"); audio.play(); } else if(keycode==66) { var audio = document.getElementById("hello2"); audio.play(); } }); }); Plis help me! red lumps appear Quote Link to comment Share on other sites More sharing options...
ShWolf Posted July 2, 2012 Report Share Posted July 2, 2012 Hi, Try to use .wav format for audio files. Also element supported in next browser versions: Firefox 3.5+, Chrome 3+, Opera 10.5+, Safari 4+, IE 9+ Let me know if this helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.