<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> imitation ie top warning bar, you can close </title>
<style type= "Text/css" >
#informationbar {
position:fixed;
left:0;
width:100%;
text-indent:5px;
padding:5px 0;
Background-color:lightyellow;
BORDER-BOTTOM:1PX solid black;
Font:bold 12px Verdana;
}
* HTML #informationbar {/*ie6 hack*/
Position:absolute;
Width:expression (document.compatmode== "Css1compat"? document.documentelement.clientwidth+ "px": body.clientWidth+ "px");
}
</style>
<script type= "Text/javascript" >
function Informationbar () {
This.displayfreq= "Always"
This.content= ' <a href= "Javascript:informationbar.close ()" >
/></a> '
}
Informationbar.prototype.setcontent=function (data) {
This.content=this.content+data
document.write (' <div id= ' Informationbar "style=" Top: -500px "> ' +this.content+ ' </div> ')
}
Informationbar.prototype.animatetoview=function () {
var barinstance=this
if (parseint (this.barref.style.top) <0) {
This.barref.style.top=parseint (this.barref.style.top) +5+ "px"
SetTimeout (function () {Barinstance.animatetoview ()}, 50)
}
else{
if (document.all &&!window. XMLHttpRequest)
This.barref.style.setExpression ("Top", ' document.compatmode== ' Css1compat "? document.documentelement.scrolltop+" PX ": body.scrolltop+" px ")
Else
This.barref.style.top=0
}
}
Informationbar.close=function () {
document.getElementById ("Informationbar"). style.display= "None"
if (this.displayfreq== "session")
Document.cookie= "infobarshown=1;path=/"
}
Informationbar.prototype.setfrequency=function (type) {
This.displayfreq=type
}
Informationbar.prototype.initialize=function () {
if (this.displayfreq== "session" && document.cookie.indexOf ("Infobarshown") ==-1 | | this.displayfreq== "always "){
This.barref=document.getelementbyid ("Informationbar")
This.barheight=parseint (This.barref.offsetHeight)
this.barref.style.top=this.barheight* ( -1) + "px"
This.animatetoview ()
}
}
Window.onunload=function () {
This.barref=null
}
</script>
<script type= "Text/javascript" >
<!--invocation code-->
var infobar=new informationbar ()
Infobar.setcontent (' Warning: Tomorrow 12 o'clock Noon to drop the money rain, please prepare the sack! ") <a href= "#" > Buy sacks </a> <a href= "#" > Buy sacks </a> ')
Infobar.initialize ()
</script>
<body>
<div>http://www.999jiujiu.com/</div>
</body>
A warning bar at the top of IE to turn off