ekh*_*led 16
在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");
Run Code Online (Sandbox Code Playgroud)
你应该有一个即时通知栏......
如果您熟悉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
Run Code Online (Sandbox Code Playgroud)
免责声明:只是一个快速的事情我掀起,如果它在IE中不起作用也不会感到惊讶
归档时间: |
|
查看次数: |
4605 次 |
最近记录: |