我想用jQuery 通知插件 https://github.com/mickeyren/jquery-notifications,但它总是将通知栏放在页面顶部。因此,如果页面很大,则必须向上滚动到顶部才能看到通知。
是否可以让通知始终显示在浏览器窗口的顶部,这样用户就不必向上滚动到页面顶部?
这是CSS,如果这是应该改变的地方?
/* 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)应该使它始终显示在顶部。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)