JS Popup Announcement

Source: Internet
Author: User
Tags border color

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.