mentalist Posted August 30, 2010 Share Posted August 30, 2010 Hi, I can embed an audio file and get it to play and stop, but I don't seem to be able to hide the big box it comes with and still play the file... Any ideas? <div style='display:none;'>x<embed id='sound' src='' width='1px' height='1px'></div> <script> function PlaySound(url){ document.getElementById('sound').src=url; } </script> <a href="#" onmouseover="PlaySound('src/2_for_joy_-_in_a_state.mp3')">Play</a> <a href="#" onmouseover="PlaySound('');">Stop</a> Also how browser safe is the underlying sound playing code? What do you use to play audio? Quote Link to comment Share on other sites More sharing options...
Omirion Posted August 30, 2010 Share Posted August 30, 2010 I have no idea about sound but you might try this. Just add an ID or Class or whatever to the container. And give it these CSS properties. position:absolute; left:-100px; Or whatever it takes to get it out of the screen. Quote Link to comment Share on other sites More sharing options...
mentalist Posted August 31, 2010 Author Share Posted August 31, 2010 Omirion, it's cheeky, but I like it... Many thanks! 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.