Call:
$ (document). Ready (function () {salert (" announcements "," content "
Method
function Salert (strtitle,strcontent) {varmsgw,msgh,bordercolor; MSGW= -;//width of the hint windowMsgh= -;//height of the prompt windowtitleheight= - //Tip Window Caption HeightBordercolor="#336699";//the border color of the hint windowTitlecolor="#99CCFF";//title color of the hint window varswidth,sheight; swidth=document.body.offsetWidth; sheight=screen.height;varBgobj=document.createelement ("Div"); Bgobj.setattribute ('ID','Bgdiv'); BgObj.style.position="Absolute"; BgObj.style.top="0"; BgObj.style.background="#777"; BgObj.style.filter="Progid:DXImageTransform.Microsoft.Alpha (style=3,opacity=25,finishopacity=75"; bgObj.style.opacity="0.6"; BgObj.style.left="0"; BgObj.style.width=swidth +"px"; BgObj.style.height=sheight +"px"; BgObj.style.zIndex="10000"; Document.body.appendChild (bgobj);varMsgobj=document.createelement ("Div"); Msgobj.setattribute ("ID","Msgdiv"); Msgobj.setattribute ("Align","Center"); MsgObj.style.background=" white"; MsgObj.style.border="1px solid"+bordercolor; msgObj.style.position="Absolute"; MsgObj.style.left="50%"; MsgObj.style.top="50%"; MsgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; MsgObj.style.marginLeft="-225px"; MsgObj.style.marginTop= - the+document.documentelement.scrolltop+"px"; MsgObj.style.width= MSGW +"px"; MsgObj.style.height=MSGH +"px"; MsgObj.style.textAlign="Center"; MsgObj.style.lineHeight="25px"; MsgObj.style.zIndex="10001"; varTitle=document.createelement ("h4"); Title.setattribute ("ID","Msgtitle"); Title.setattribute ("Align"," right"); Title.style.margin="0"; title.style.padding="3px"; Title.style.background=bordercolor; Title.style.filter="progid:DXImageTransform.Microsoft.Alpha (startx=20, starty=20, finishx=100, finishy=100,style=1,opacity=75, finishopacity=100);"; title.style.opacity="0.75"; Title.style.border="1px solid"+bordercolor; title.style.height="18px"; Title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif"; Title.style.color=" white"; Title.style.cursor="Pointer"; Title.title="Click Close"; title.innerhtml="<table border= ' 0 ' width= ' 100% ' ><tr><td align= ' left ' ><b>"+ Strtitle +"</b></td><td> Close </td></tr></table></div>"; Title.onclick=function () {document.body.removeChild (bgobj); document.getElementById ("Msgdiv"). removechild (title); Document.body.removeChild (msgobj); } document.body.appendChild (msgobj); document.getElementById ("Msgdiv"). appendchild (title); varTxt=document.createelement ("P"); Txt.style.margin="1em 0"; Txt.setattribute ("ID","MsgTxt"); Txt.innerhtml=strcontent; document.getElementById ("Msgdiv"). appendchild (txt);}
JS Popup Announcement