我在 row-fluid 中有一个警报。参见 my fiddle .当我使用“x”按钮关闭警报时,该行仍然可见。当我解雇它时,如何摆脱整行?我试过:
data-dismiss="row-fluid"
它不允许我关闭任何东西。
最佳答案
我想不出不涉及一点点 jQuery 的解决方案。如果您可以使用 jQuery,那么下面的解决方案就可以了。
为隐藏该行的点击事件附加一个函数。 (我添加了“错误”类,以便我可以只选择那一行)。
查看更新后的 fiddle :http://jsfiddle.net/D2RLR/2765/
<div class="container-fluid">
<div class="row-fluid error" style="border:1px solid red;">
<div class="span4">
<div class="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
</div>
</div>
<div class="row-fluid" style="border:1px solid red;">
<div class="span12">
this is some other content
</div>
</div>
</div>
<script>
$('.close').click(function(){
$(".row-fluid.error").hide()
});
</script>
关于css - 当我关闭 Bootstrap 警报时,如何摆脱整行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12964941/