這個腳本在IE瀏覽器中失敗,彈出窗口,但關閉按鈕不工作,它在firfox和谷歌瀏覽器中工作正常。彈出式關閉按鈕在Internet Explorer中不起作用?
#note {
position: relative;
z-index: 101;
top: 0;
left: 0;
right: 0;
background: #fde073;
text-align: center;
line-height: 2.5;
overflow: hidden;
-webkit-box-shadow: 0 0 5px black;
-moz-box-shadow: 0 0 5px black;
box-shadow: 0 0 5px black;
}
<div id="note">
You smell good. <a id="close">[close]</a>
<script>
close = document.getElementById("close");
close.addEventListener('click', function() {
note = document.getElementById("note");
note.style.display = 'none';
}, false);
</script></div>
這是可以在其他瀏覽器中使用嗎? – 2014-12-04 05:17:45
根據用戶在Firefox和Chrome中工作。 – AaronS 2014-12-04 05:18:32
您正在測試什麼版本的Internet Explorer? – AaronS 2014-12-04 05:26:36