网站建设问题分类和排除方法分析,龙江网站设计,怎样在wordpress里添加菜单,网站后台怎么控制功能#xff1a;替换传统弹出窗口提示 window.alert();好处#xff1a;界面美观#xff0c;友善(最起码没有系统报警的声音#xff09;。引用方便#xff0c;纯js脚本文件实现所有效果。使用方法#xff1a;!DOCTYPE html PUBLIC -//W3C//DTD XHTM…功能替换传统弹出窗口提示 window.alert();好处界面美观友善(最起码没有系统报警的声音。 引用方便纯js脚本文件实现所有效果。使用方法!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdhtml xmlnshttp://www.w3.org/1999/xhtml xml:langzh-CN langzh-CN head titleAlert提示效果脚本/title meta http-equivContent-Type contenttext/html; charsetgb2312 / meta http-equivContent-Language contentgb2312 / meta nameKeyWords content电力工程造价,价格信息,装材,设备,电力工程 / meta namedescription content电力工程造价信息 / script typetext/javascript srcalert.js/script style typetext/css *{}{ margin:0;padding:0; } /style /head body div classcecmbody idcecmpolicy div classleftClass p测试/pp测试/pp测试/p p测试/pp测试/pp测试/p p测试/pp测试/pp测试/p input typebutton value点击这里 οnclicksAlert(测试效果); / p测试/pp测试/pp测试/p p测试/pp测试/pp测试/p p测试/pp测试/pp测试/p /div div classrightClass /div /div /body/html脚本文件alert.js /**//* 作者Daviv 博客http://blog.163.com/jxdawei 时间2006-10-27 感谢wenming (Blueidea) 功能弹出提示 方法调用sAlert(您要弹出的信息); */ function sAlert(str){ var msgw,msgh,bordercolor; msgw400;//提示窗口的宽度 msgh100;//提示窗口的高度 titleheight25 //提示窗口标题高度 bordercolor#336699;//提示窗口的边框颜色 titlecolor#99CCFF;//提示窗口的标题颜色 var sWidth,sHeight; sWidthdocument.body.offsetWidth; sHeightdocument.body.offsetHeight; if (sHeightscreen.height) { sHeightscreen.height; } var bgObjdocument.createElement(div); bgObj.setAttribute(id,bgDiv); bgObj.style.positionabsolute; bgObj.style.top0; bgObj.style.background#777; bgObj.style.filterprogid:DXImageTransform.Microsoft.Alpha(style3,opacity25,finishOpacity75; bgObj.style.opacity0.6; bgObj.style.left0; bgObj.style.widthsWidth px; bgObj.style.heightsHeight px; bgObj.style.zIndex 10000; document.body.appendChild(bgObj); var msgObjdocument.createElement(div) msgObj.setAttribute(id,msgDiv); msgObj.setAttribute(align,center); msgObj.style.backgroundwhite; msgObj.style.border1px solid bordercolor; msgObj.style.position absolute; msgObj.style.left 50%; msgObj.style.top 50%; msgObj.style.font12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif; msgObj.style.marginLeft -225px ; msgObj.style.marginTop -75document.documentElement.scrollToppx; msgObj.style.width msgw px; msgObj.style.height msgh px; msgObj.style.textAlign center; msgObj.style.lineHeight (msgh-titleheight) px; msgObj.style.zIndex 10001; var titledocument.createElement(h4); title.setAttribute(id,msgTitle); title.setAttribute(align,right); title.style.margin0; title.style.padding3px; title.style.backgroundbordercolor; title.style.filterprogid:DXImageTransform.Microsoft.Alpha(startX20, startY20, finishX100, finishY100,style1,opacity75,finishOpacity100);; title.style.opacity0.75; title.style.border1px solid bordercolor; title.style.height18px; title.style.font12px Verdana, Geneva, Arial, Helvetica, sans-serif; title.style.colorwhite; title.style.cursorpointer; title.innerHTML关闭; title.οnclickfunction(){ document.body.removeChild(bgObj); document.getElementById(msgDiv).removeChild(title); document.body.removeChild(msgObj); } document.body.style.overflow hidden; document.body.appendChild(msgObj); document.getElementById(msgDiv).appendChild(title); var txtdocument.createElement(p); txt.style.margin1em 0 txt.setAttribute(id,msgTxt); txt.innerHTMLstr; document.getElementById(msgDiv).appendChild(txt); }转载于:https://www.cnblogs.com/Bany/archive/2006/12/01/1755510.html