首页 > 解决方案 > 无法单击模态中的按钮

问题描述

我有一个使用以下 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>

标签: javascripthtmlcss

解决方案


推荐阅读