兼容chrome和ie的wav音乐播放(Ie7 Ie8 Ie9 均测试过 )
2017-05-22 15:49
603 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>aa</title> <script> function playSound(){ //IE放 背景音乐 var snd_ie = document.getElementById('snd_ie'); snd_ie.src = "./alert.wav" //chrome var snd_chrome = document.getElementById('snd_chrome'); snd_chrome.data = "./alert.wav" } function stopSound(){ var snd_ie = document.getElementById('snd_ie'); snd_ie.src = "" var snd_chrome = document.getElementById('snd_chrome'); snd_chrome.data = "" } </script> </head> <body> <bgsound id='snd_ie' src="" loop=-1></loop> <object id='snd_chrome' width="0px" height="0px" type="audio/x-wav" data=""></object> <input type="button" value="开始" onclick="playSound()"> <input type="button" value="暂停" onclick="stopSound()"> </body> </html>
相关文章推荐
- 多图片上传+图片预览,兼容所有浏览器 IE5/IE6/IE7/IE8/IE9/Chrome/Safari/Firefox/Opera/
- 多图片上传+图片预览,兼容所有浏览器 IE5/IE6/IE7/IE8/IE9/Chrome/Safari/Firefox/Opera/
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- IE等主流浏览器css hack,包括IE6,IE7,IE8,IE9,firefox,chrome
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- 如何让div+css兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- IE6/IE7/IE8/Firefox/Chrome/Safari的CSS hack兼容一览表
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法(原创理论)
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome方法
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- 【转贴】div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- div+css 兼容 ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10
- CSS实现透明度(兼容IE6 IE7 IE8 FF CHROME,其他还未测试)
- IE6,IE7,IE8,IE9,FIREFOX,Chrome等浏览器兼容详解收集
- 一行代码解决各种IE兼容问题,IE6,IE7,IE8,IE9,IE10