Bootstrap模态 - 显示奇怪的形状

时间:2017-02-14 03:58:34

标签: javascript jquery html css twitter-bootstrap

我遇到了一个问题,即启动模式显示3个点/ 3个框并将其放在div中,问题似乎只出现在Chrome浏览器上。

之前有没有人面临同样的问题?非常感谢帮助。

请参阅图片:

HTMLCode

enter image description here

Modal1

enter image description here

Modal2

enter image description here



//==============================  //
// Page Load                      //
// ============================== //
$(window).load(function() {
  $('#myModal').modal('show');
  $('#inputModalCompanyCode').focus();

});

//==============================  //
// Static Modal                   //
// ============================== //
$('#myModal').modal({
  backdrop: 'static',
  keyboard: false
});

//===============================  //
// KeyPress-CompanyCode           //
// ============================== //
function EnterEventCompanyCode(e) {
  var keyCode = (e.which) ? e.which : e.keyCode
  if ((keyCode < 65 || keyCode > 90) && (keyCode < 97 || keyCode > 123) && keyCode != 32) {
    e.preventDefault();
  }
  if (e.keyCode === 13) {
    __doPostBack("<%=lbSubmitMyModal.UniqueID %>", "");
  }
}

//===============================  //
// KeyPress-Password           //
// ============================== //
function EnterEventPassword(e) {
  if (e.keyCode == 13) {
    GetClientUTCOffset();
    __doPostBack("<%=lbSubmit.UniqueID %>", "");
  }
}

//================================  //
// Get Client UTC Offset           //
// ============================== //
function GetClientUTCOffset() {
  var date = new Date();
  var offset = date.getTimezoneOffset();
  document.getElementById("<%=hfClientUTCOffset.ClientID%>").value = offset;
  return true;
}
&#13;
.card-container.card {
  max-width: 470px;
  padding: 40px 40px;
}
.card {
  background-color: #F7F7F7;
  /* just in case there no content*/
  padding: 20px 25px 30px;
  margin: 0 auto 25px;
  margin-top: 50px;
  /* shadows and rounded borders */
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
  -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
.logo-img {
  width: 200px;
  height: auto;
  margin: 0 auto 10px;
  display: block;
}
.form-signin #inputEmail,
.form-signin #inputPassword {
  direction: ltr;
  font-size: 16px;
}
.form-signin input[type=email],
.form-signin input[type=password],
.form-signin input[type=text],
.form-signin button {
  width: 100%;
  display: block;
  margin-bottom: 10px;
  z-index: 1;
  position: relative;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.form-signin .form-control:focus {
  border-color: rgb(104, 145, 162);
  outline: 0;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgb(104, 145, 162);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgb(104, 145, 162);
}
.AssemblyVersion {
  color: #337ab7;
}
#myModal .modal-dialog {
  width: 350px;
  margin-top: 70px;
}
&#13;
<!DOCTYPE html>
<html lang="en">

<head>
  <meta name="Login" content="When technology meets security" charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  <title>CASE Global</title>
  <link rel="shortcut icon" type="image/png" href="Images/favicon.ico" />
  <!-- Bootstrap -->
  <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
  <link href="CSS/Login.css" rel="stylesheet" />
  <!-- End Bootstrap -->

  <!-- Captcha ReCaptcha -->


</head>

<body>



  <div class="container">
    <div class="card card-container">
      <img id="logo-img" alt="CompanyLogo" class="logo-img" src="Some Logo" />
      <form id="loginform" runat="server" class="form-signin" action="login.aspx" method="post">
        <asp:HiddenField ID="hfClientUTCOffset" runat="server" />

        <div class="modal fade" id="myModal" runat="server" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
          <div id="divModalDialog" class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <img id="imgCaseLogo" alt="CompanyLogo" class="logo-img" src="Some Logo" />
              </div>
              <div class="modal-body">
                <input type="text" id="inputModalCompanyCode" runat="server" class="form-control" name="companycode" placeholder="Company Code" onkeypress="return EnterEventCompanyCode(event)" required="true" />
              </div>
              <div class="modal-footer">
                <asp:LinkButton ID="lbSubmitMyModal" runat="server" class="btn btn-lg btn-primary btn-block btn-signin" Text="Submit"></asp:LinkButton>

                <center>
                  <div id="divInvalidCC" runat="server" class="alert alert-danger" visible="false"> <strong id="strongAlertCC" runat="server"></strong>
                  </div>
                </center>
              </div>
            </div>
          </div>
        </div>


        <input type="text" id="inputUserName" runat="server" class="form-control" name="username" placeholder="User Name" tabindex="1" required="true" />
        <input type="password" id="inputPassword" runat="server" class="form-control" name="password" placeholder="Password" tabindex="2" onkeypress="return EnterEventPassword(event)" />
        <input type="text" id="inputCompanyCode" runat="server" class="form-control" name="companycode" placeholder="Company Code" tabindex="3" required="true" />
        <div id="divForgotPassword" class="signin-help" runat="server" visible="false">
          <p>forgot your password?
            <asp:LinkButton ID="lbForgotPassword" runat="server">click here</asp:LinkButton>
          </p>
        </div>


        <div id="divRecapcha" runat="server">
          <center>
            <div id="grecaptcha" runat="server" class="g-recaptcha" data-sitekey="Masking it for now" data-tabeindex="0"></div>
          </center>
        </div>

        <asp:LinkButton ID="lbSubmit" runat="server" class="btn btn-lg btn-primary btn-block btn-signin" Text="Login" OnClientClick="GetClientUTCOffset();"></asp:LinkButton>

        <div id="divAlertAuthentication" runat="server" class="alert alert-danger" visible="false">
          <strong id="strongAlertAuthentication" runat="server"></strong> 
        </div>

        <div id="divWarningAuthentication" runat="server" class="alert alert-warning" visible="false">
          <strong id="strongWarningAuthentication" runat="server"></strong> 
        </div>

        <div>
          <span id="spanVersion" runat="server" class="AssemblyVersion"></span>
        </div>

      </form>
      <!-- /form -->
    </div>
  </div>

  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

     
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
     <script type="text/javascript" src='https://www.google.com/recaptcha/api.js'></script>
</body>
</script>
</html>
&#13;
&#13;
&#13;

//上面的代码使用bootstrap和ReCaptcha显示模式。

0 个答案:

没有答案