我编写了以下代码,以在页面加载时加载弹出窗口,但是,当我单击“继续”以关闭弹出窗口时-没有任何反应。按钮缩进,但弹出框保持原状。我想知道是否有人有什么想法?
<p>This is the normal text that would be on the page anyway.</p>
<p>There's an awful lot of this text on a normal page with lots of graphics and stuff as well.</p>
<div id="reminderPopup">
<div class="popupBackground">
<div class="popupInner">
<h2>Remember, if you have opened and resolved a complaint on this call to close the ADR.</h2>
<p><!--additional text here--></p>
<button id="close" onclick="closeReminderPopup()">Continue</button>
<p> </p>
</div>
</div>
</div>
<script type="text/javascript">
function pageLoadCompleteEvent(){
document.getElementById("reminderPopup").style.display="block";
};
function closeReminderPopup(){
document.getElementById("reminderPopup").style.display="none";
};
</script>
答案 0 :(得分:0)
您的代码可以正常工作。尝试在代码段工具中运行它:
function pageLoadCompleteEvent(){
document.getElementById("reminderPopup").style.display="block";
};
function closeReminderPopup(){
document.getElementById("reminderPopup").style.display="none";
};
<html>
<body>
<p>This is the normal text that would be on the page anyway.</p>
<p>There's an awful lot of this text on a normal page with lots of graphics and stuff as well.</p>
<div id="reminderPopup">
<div class="popupBackground">
<div class="popupInner">
<h2>Remember, if you have opened and resolved a complaint on this call to close the ADR.</h2>
<p><!--additional text here--></p>
<button id="close" onclick="closeReminderPopup()">Continue</button>
<p> </p>
</div>
</div>
</div>
</body>
</html>