javascript - 弹出式点击在其他几个网站页面中不起作用
问题描述
我在 footer.php 页面中定义了弹出按钮,因此它也适用于其他页面,但点击仅适用于其他页面的索引页面点击不起作用。我试图创建几乎每个网页都出现的弹出式录取查询表单,这就是我在 footer.php 页面中声明弹出式的原因。但它仅适用于索引页面而不适用于其他页面。
var s=document.createElement("script");
s.type="text/javascript";
s.async=true;
s.src="https://widgets.nopaperforms.com/emwgts.js";
document.body.appendChild(s);
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
padding-top: 100px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal .close {
position: absolute;
top: 35px;
left: 25px;
background: #00495d;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #fff;
padding: 0px 5px;
}
.modal.close:hover {
color: #ffffff;
}
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
}
<div class="container sl-mob">
<p class="enfrm3">
<button id="myBtn" class="bt bt-md bt-bg bt-tertiary">
<b>Admission Query</b>
</button>
</p>
<div id="myModal" class="modal">
<div class="modal-content">
<a class="close" href="#">X</a>
<center><h4><p>Admission Query</p></h4></center>
<div class="npf_wgts" style="width: 100%" data-height="400px" data-w="89e4d80f52cf4e3287e5d3d064911c16"></div>
</div>
</div>
</div>
解决方案
推荐阅读
- python - AWS SES 邮件接收和解析
- java - Spring RestTemplate 忽略 package-info.java
- ionic-framework - 在 Ionic 中调整 base64 编码图像的大小
- reactjs - 在创建新的小部件-Reactjs,Redux 时,在调度之间检测到状态突变
- python - 从文本文件中排除行(Python)
- lua - Lua 查找字符串中可能有空格的字符串
- nosql - 对沙发数据库中的复杂键进行排序
- android - 如何从 Android 应用更新自定义日历上的多个客人
- c - 使用 afl-gcc 编译 - 未检测到检测
- r - 遍历列表以通过其名称获取值