jquery - 如何显式设置登录模式的高度?

标签 jquery html css modal-dialog

我正在为网站开发引导登录模式。在首页,modal的高度是正常的,如下图。

http://i.stack.imgur.com/hNYCe.png

但是,当我转到网站上的其他页面并触发带有顶部链接的模式时,窗口被拉伸(stretch)到随机大小,我无法弄清楚它是从哪里获取的。

这是模态的代码

<!-- begin login modal -->
<div id="login_modal" class="modal hide-on-small" style="width: 500px !important; padding-left: 20px; padding-right: 20px; padding-top: 20px; padding-bottom: 20px;" data-swiftype-index='false'>
    <div class="account-login clearer">
        <div class="page-title">
            <h1>Login or Create an Account</h1>
        </div>

    <form action="/customer/account/loginPost/" method="post" id="login-form">
        <div class="new-users grid12-6">
            <div class="content">
                <h2>New Customers</h2>
                <p>By creating an account, you'll be able to move through the checkout process faster, store multiple shipping address, view your order, track and redeem your reward points!</p>
            </div>
            <div class="buttons-set">
                <button type="button" title="Create an Account" class="button" onclick="window.location='/customer/account/create/';"><span><span>Create an Account</span></span></button>
            </div>
            <p>Log in with your Facebook account!</p>
            <a href="#" onclick="return fblogin();" class="fb_button_ps"><img src="http://www.empowered.org/public/images/fb_login.png"></a>
        </div>

        <div class="registered-users grid12-6">
            <div class="content">
                <h2>Registered Customers</h2>

                <p>If you have an account with us, please log in. <br><a href="/customer/account/forgotpassword/">Forgot Your Password?</a></p>

                <ul class="form-list">
                    <li>
                        <label for="email" class="required"><em>*</em>Email Address</label>
                        <div class="input-box">
                            <input type="text" name="login[username]" value="" id="email" class="input-text required-entry validate-email" title="Email Address" style="width:200px;">
                        </div>
                    </li>
                    <li>
                        <label for="pass" class="required"><em>*</em>Password</label>
                        <div class="input-box">
                            <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="Password" style="width:200px;">
                        </div>
                    </li>
                </ul>
            </div>
            <div class="buttons-set">
                <button type="submit" class="button" title="Login" name="send" id="send2"><span><span>Login</span></span></button>
            </div>
        </div>

    </form>
</div>
</div>
<!-- end login modal -->

这里是对应的CSS

#signup_modal p {
margin-top: 5px;
margin-bottom: 5px;
}
#signup_modal .signup_secondary {
margin-top: 10px;
margin-bottom: 0;
}
#signup_modal h2 {
color: #f05002;
margin: 0;
font-weight: 600;
}
.modal_sub:hover {
background-color: #f6f9f2;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
border-color: transparent;
cursor: hand;
cursor: pointer;
}
.modal_sub_price {
margin-left: 16px;
}
.modal_sub img {
margin-bottom: 13px;
}
.modal_sub span {
margin-bottom: 0;
}
.modal_sub .bulu_btn_signup_mini {
margin-bottom: 13px;
}

.modal {
display: none;
width: 600px;
background: #fff;
padding: 15px 30px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-o-border-radius: 8px;
-ms-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 0 10px #000;
-moz-box-shadow: 0 0 10px #000;
-o-box-shadow: 0 0 10px #000;
-ms-box-shadow: 0 0 10px #000;
box-shadow: 0 0 10px #000;
}
.modal a.close-modal {
position: absolute;
top: -12.5px;
right: -12.5px;
display: block;
width: 30px;
height: 30px;
text-indent: -9999px;
background: url(/assets/modal/close.png) no-repeat 0 0;
}
.modal-spinner {
display: none;
width: 64px;
height: 64px;
position: fixed;
top: 50%;
left: 50%;
margin-right: -32px;
margin-top: -32px;
background: url(/assets/modal/spinner.gif) #111 no-repeat center center;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-o-border-radius: 8px;
-ms-border-radius: 8px;
border-radius: 8px;
}

有没有办法显式设置模态框的高度?在此先感谢您的帮助!

http://jsfiddle.net/44Yua/是它的 fiddle 。它缺少一点样式,但其余的都在那里。

最佳答案

事实证明它不是 Bootstrap 模式,但通过对 css height 属性进行一些修改,我让它开始工作。

另一个页面上也有一些冲突的 css 导致它失败。伙计,注意你的样式表。

关于jquery - 如何显式设置登录模式的高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24019186/

相关文章:

html - 导航栏不折叠

jquery - 从左向右滑动 div,但不是从页面左侧滑动?

html - 按钮内的资源管理器工具提示

javascript - jQuery onclick 不显示导航

javascript - 检查多个输入空值不起作用

html - 如果我在 ClipPath 内使用 <path> ,则 ClipPath 不起作用,但它适用于 <circle>

python - 在python中解码html编码的字符串

javascript - knockout 绑定(bind)元素到 Bootstrap 菜单

javascript - JQuery 检查输入是否为空而不检查加载?

javascript - 如何根据加载的内容设置 "loading spinner"的持续时间