在 firebug 或 document.ready() 上运行此代码
$("<div id='notification'>Notification text here</div>").css({
position:"fixed",
top:"0px",
left:"0px",
height:"20px",
width:"100%",
backgroundColor:"#cccccc",
color:"blue",
padding:"5px",
fontWeight:"bold",
textAlign:"center",
opacity:"0.5"
})
.appendTo("body");
你应该有一个即时通知栏...
如果您熟悉 jQuery(我假设您熟悉,因为问题是用 jquery 标记的),您可以调整 CSS 和 HTML 值以满足您的需要...
要让它向下滑动,你可以这样做:
$("<div id='notification'>Notification text here</div>").css({
position:"fixed",
top:"0px",
left:"0px",
height:"20px",
width:"100%",
backgroundColor:"#cccccc",
color:"blue",
padding:"5px",
fontWeight:"bold",
textAlign:"center",
display:"none", //<-- notice this new value
opacity:"0.5"
})
.appendTo("body");
$("#notification").slideDown("slow"); //<-- this is the animation code
免责声明:只是我快速完成的一个东西,如果它在 IE 中不起作用也不会感到惊讶