如何在屏幕顶部显示通知? [英] How to show notification on top of screen?

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

问题描述

我想使用 jQuery通知插件,但它始终将通知栏放在页面顶部。因此,如果页面很大,则必须向上滚动到顶部才能看到通知。

I would like to use jQuery Notifications plugin, but it always puts the notification bar on the top of the page. So if the page it big, one have to scroll up to the top to see the notification.

可以让通知总是显示在顶部浏览器窗口,所以用户不必向上滚动到页面顶部?

Would it be possible to have the notification always show up in the top of the browser window, so the user won't have to scroll up to the top of the page?

这是CSS,如果这是一个这样的东西应该改变?

This is the CSS, if that's where such a thing should be changed?

/* jQuery Notifications plugin - http://programmingmind.com */
/* notification container */
#jquery-notifications {
  position: relative;
  width: 100%;
  left: 0;
  top: 0;
  z-index: 100000;
}
#jquery-notifications p {
  text-align: center;
  position: relative;
  margin: 0;
  padding: 5px;
  padding-left: 10px;
  border-bottom: 2px solid;
  /* style property for the close text */
}
#jquery-notifications p a {
  position: absolute;
  right: 10px;
  margin-right: 10px;
  color: black;
  text-decoration: none;
  border: 1px solid black;
  padding-right: 5px;
  padding-left: 5px;
}
#jquery-notifications .notice {
  background: #6c9ffc;
  color: #061a72;
  border-color: #061a72;
}
#jquery-notifications .success {
  background: #96f96f;
  color: #045419;
  border-color: #045419;
}
#jquery-notifications .warning {
  background: #f7ae57;
  color: #753903;
  border-color: #753903;
}
#jquery-notifications .error {
  background: #f97c6f;
  color: #570f01;
  border-color: #570f01;
}


推荐答案

不知道标记

但是添加 position:fixed; 到容器(#jquery-notifications)应该始终显示在顶部。

But adding position: fixed; to the container (#jquery-notifications) should make it show up on top at all times.

这篇关于如何在屏幕顶部显示通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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