Man*_*ria 5 html css jquery twitter-bootstrap twitter-bootstrap-3
Image #1:带有.in 类的Bootstrap 警报:
Image #2:没有.in 类的Bootstrap Alert (隐藏下面的内容):
自过去三个小时以来,我一直在努力使警报完美运行 - 不取代其他内容。我已经阅读了一些博客文章和 SO Q&A,但无法达到预期的效果。
尝试:
display: none;
内容有效地取代。HTML:
<div class="alert alert-message alert-info fade"><p> Joined: StaticRoom </p></div>
Run Code Online (Sandbox Code Playgroud)
JavaScript:
function status(type, msg) {
var alertHTML = "<div class='alert alert-message alert-" + type + " fade'><p> " + msg + " </p></div>";
$("#roomInfo").html(alertHTML);
$(".alert-message").addClass("in");
setTimeout(function () {
$(".alert-message").removeClass("in");
}, 3000);
}
Run Code Online (Sandbox Code Playgroud)
图片#3:期望:
帮助!
这是自我警觉造成的height
,padding
而且margin
。该类.fade
仅更改opacity
值,不再更改:
摘自bootstrap.css
.fade{
opacity:0;
-webkit-transition:opacity .15s linear;
transition:opacity .15s linear
}
.fade.in{
opacity:1
}
Run Code Online (Sandbox Code Playgroud)
你可以做的是用以下命令覆盖 Bootstrap CSS:
.fade {
height: 0;
padding: 0;
margin: 0;
-webkit-transition:height .15s linear;
transition:height .15s linear;
}
.fade.in {
height: auto;
padding: 15px;
margin-bottom: 20px;
}
Run Code Online (Sandbox Code Playgroud)
**编辑**
我没有得到你想要的绝对定位警报。因此,您不需要任何额外的类,只需一个简单的:
.movie {
position: relative;
width: 430px;
margin: 20px auto;
padding: 5px;
padding-bottom: 40px; /* give extra space for form */
}
.movie form {
position: absolute;
bottom: 0; left: 0; right: 0;
padding: 5px;
}
.movie .alert {
position: absolute;
bottom: 30px; left: 5px; right: 5px;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10353 次 |
最近记录: |