如何始终在顶部显示boostrap / angularUI警报? [英] How do display a boostrap/angularUI alert always on top?

查看:99
本文介绍了如何始终在顶部显示boostrap / angularUI警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用):

 < div style = position:fixed; top:0; right:0> 
< alert ng-repeat =警报警报 type = {{alert.type}} close = closeAlert($ index)>
{{alert.msg}}
< / alert>
< / div>


I'm displaying some alerts using angular-UI which is basically powered by bootstrap. However the issue is that the alerts can't be seen by the client if they are navigating to the bottom of the page. I would like to know how can I display the alerts always on top ( I think the right term is "on fixed position" )

解决方案

How exactly do you want it to work? It might be easiest to use a library like PNotify or AngularJS-Toaster (plnkr).

If you want to do it yourself, you could put them in a special area. For something like this you can put the alerts in a div that is position:fixed (plnkr):

<div style="position: fixed; top: 0; right: 0">
  <alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">
      {{alert.msg}}
  </alert>
</div>

这篇关于如何始终在顶部显示boostrap / angularUI警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆