0
當我單擊按鈕時,我正在使用javascript函數播放mp3文件。Chrome中的Javascript函數會使黑色線條顯示
var soundEmbed = null;
function soundPlay(url) {
if (soundEmbed)
document.body.removeChild(soundEmbed);
soundEmbed = document.createElement("embed");
soundEmbed.setAttribute("src", "/snd/"+url+".mp3");
soundEmbed.setAttribute("hidden", true);
soundEmbed.setAttribute("autostart", true);
document.body.appendChild(soundEmbed);
}
在谷歌瀏覽器當我點擊該按鈕時,播放聲音,但是在右側的滾動條變成黑線和有黑色的窗口的左側的頂部的薄帶。在Firefox和IE上,它很好,沒有黑線。
任何人都知道問題是什麼/如何解決它?
此外,當我把soundEmbed.setAttribute("loop", true);
在那裏,它不會循環在鉻上,而它與IE/Firefox的。
你試過'soundEmbed.setAttribute(「style」,「display:none」);'? – sje397
剛試過。沒有工作。 – Michael
我剛剛在我的Chrome 14.0.835.109 beta-m上進行了測試,我沒有看到任何視覺不規則。你能告訴我們你的HTML嗎? – ZenMaster