css - 带有 Bootstrap 警报的 Angularjs - 向下滚动时在屏幕上保持警报

标签 css angularjs twitter-bootstrap alert angular-ui-bootstrap

我正在使用来自 http://angular-ui.github.io/bootstrap/

<div ng-controller="AlertDemoCtrl">
     <alert ng-repeat="alert in alerts" type="{{alert.type}}"
        close="closeAlert($index){{alert.msg}}>    
    </alert>
    <button class='btn btn-default' ng-click="addAlert()">Add Alert</button>
</div>

当我向下滚动时,警报从屏幕上消失了。 如何在用户向下滚动时向下移动警报?

最佳答案

我建议在您的警报中添加一个类别。然后按照@DeadCalimero 的建议,添加以下 css:

.alert-float {
  position: fixed,
  top: 10px,    // adjust if needed
  z-index: 1000 // or higher if needed
}

关于css - 带有 Bootstrap 警报的 Angularjs - 向下滚动时在屏幕上保持警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26003665/

相关文章:

javascript - YUI 缩小时出现 Angular 捕获关键字错误

html - 如何使用 .less 文件制作网站的可变主题(如更改品牌颜色等)

html - 如何将 navbar-brand 与其余链接对齐

twitter-bootstrap - Bootstrap 词缀和溢出-y 冲突

javascript - 如何使用 jquery 和 javascript 将 html 元素向左移动

html - 在 CSS 中自动调整倾斜背景(+ 图像?)

angularjs - 如何在 Angular 表达式中当数字等于 0 时显示空字符串

javascript - anguarl1 ng-repeat 在父项 ng-init 中异步返回的项目上

css - 问题 :Menu Hide behind PDF in IE

html - zurb 基础 block 网格和均衡器