javascript - 无法单击模态中的按钮
问题描述
我有一个使用以下 CSS 创建的模式。但是当我打开它时,它会出现并允许我填写表单字段,但单击按钮(它们具有 onclick 事件)绝对没有任何作用 - 我尝试将按钮设置为打开新页面的简单链接,但它们没有也这样做。我在 SquareSpace 页面中执行此操作。我希望这不会使事情复杂化。
<style>
.info-modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: visible;
transform: scale(1.1);
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}
.info-modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
padding: 1rem 1.5rem;
width: 400px;
border-radius: 0.5rem;
}
.info-continue-button {
background-color: #0069d9;
border-color: #0062cc;
position: relative;
width: 100px;
font-family: "Oxygen", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #fff;
}
.info-continue-button:hover {
color: #fff;
}
.info-show-modal {
opacity: 1;
visibility: visible;
transform: scale(1.0);
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}
.info-field {
color: inherit;
font: inherit;
margin: 0;
line-height: normal;
margin-bottom: 15px;
background-color: #fff;
border-radius: 0;
-webkit-appearance: none;
box-shadow: none;
box-sizing: border-box;
transition: all 0.3s ease-in-out;
width: 100%;
max-width: 400px;
height: 32px;
border: 0;
border-bottom: 2px solid #d1d1d1;
padding: 8px 0;
border-bottom-color: #2d56bb;
}
.info-modal button {
font: inherit;
margin: 0;
overflow: visible;
-webkit-appearance: button;
font-family: "Adamina", Georgia, serif;
display: inline-block;
height: 40px;
text-align: center;
font-size: 12px;
line-height: 38px;
letter-spacing: 2px;
text-transform: uppercase;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
box-sizing: border-box;
transition: all 0.3s ease-in-out;
margin-bottom: 10px;
color:#000;
outline: 0;
padding: 0 30px !important;
background-color: #e0e0e0;
border: 0;
font-weight: 700;
}
.info-modal button:hover {
color: #01855e;
}
.info-modal button[type='submit'].-disabled {
pointer-events: none;
cursor: not-allowed;
opacity: 0.4;
}
.info-modal p {
margin-bottom:0px;
}
</style>
解决方案
推荐阅读
- angular - 使用 AOT 构建项目时,自定义库中的 Angular 8 延迟加载路由在运行时中断
- javascript - [JS, html]未捕获的类型错误:无法读取 null 的属性“addEventListener”
- sql-server - SSRS:IIF 语句更改填充颜色错误
- regex - 提取 Google 表格单元格中的部分内容
- javascript - TypeError:无法在“Node”上执行“appendChild”:参数 1 不是“Node”类型。尝试附加反应元素时
- php - xpath 表达式的结果是:[object Text]。它应该是一个元素
- swift - 在模拟器上录制和播放音频,但在真实的 iPhone 设备上不行
- visual-studio - 用于 Visual Studio 构建的示例 Jenkins 文件?
- c# - 脚手架后的 Entity Framework Core 和 MySQL 错误与日期时间值
- java - Android Studio - VideoView 只播放带有 https 而不是 http 的视频