可能重复:
通知面板类似于 stackoverflow 的
How to show popup message like in stackoverflow
Stackoverflow 如何处理“您获得了新徽章”窗口?(屏幕顶部弹出的橙色,我相信它会在您未登录时向您显示常见问题解答)。
有人有代码示例可以做到这一点吗?(也有关闭窗口的按钮?)
可能重复:
通知面板类似于 stackoverflow 的
How to show popup message like in stackoverflow
Stackoverflow 如何处理“您获得了新徽章”窗口?(屏幕顶部弹出的橙色,我相信它会在您未登录时向您显示常见问题解答)。
有人有代码示例可以做到这一点吗?(也有关闭窗口的按钮?)
这是一个非常简单的 HTML、CSS 和 DOM 操作练习。 看看http://jquery.com添加效果等...
在你的 CSS 中使用这些样式:
#banner
{
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #aaf;
color: #000;
font-size: 1.5em;
padding: .5em;
z-index: 100;
}
你页面上的这个HTML:
<div id="banner">
Your text here
<a href="#" onclick="document.getElementById('banner').style.display = 'none'; return false;">close</a>
</div>
应该做的伎俩。使用样式等...使其看起来不错。