首页  »  网页设计教程  »  JS实现仿新浪信息提示效果

JS实现仿新浪信息提示效果

浏览数:共 645 次     评论:共 0 条     发布日期:2012-04-12     分类:javascript

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">
<head>
<meta name="verify-v1" content="p4t6ffcipvxqmwz2eztyxvzmhlnwd0wlqoq6lbhn5y8=" />
<title>政策文件_中国电力工程造价信息网</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta http-equiv="content-language" content="gb2312" />
<meta name="keywords" content="电力工程造价,价格信息,装材,设备,电力工程" />
<meta name="description" content="电力工程造价信息" />
<style type="text/css">
*{
margin:0;padding:0;
}
</style>
</head>
<body>

<div class="cecmbody" id="cecmpolicy">
<div class="leftclass">
<a href=http://www.webjx.com>网页教学网</a>
<input type="button" value=" " onclick="salert(’hello’);" />
</div>
<div class="rightclass">
</div>
</div>
<script type="text/javascript" language="javascript">
//author:daviv
//blog:http://blog.163.com/jxdawei
//date:2006-10-27
//email:jxdawei@gmail.com
function salert(str){
var msgw,msgh,bordercolor;
msgw=400;//提示窗口的宽度
msgh=100;//提示窗口的高度
titleheight=25 //提示窗口标题高度
bordercolor="#336699";//提示窗口的边框颜色
titlecolor="#99ccff";//提示窗口的标题颜色

var swidth,sheight;
swidth=document.body.offsetwidth;
sheight=screen.height;
var bgobj=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);

var msgobj=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%";
&



上一篇:让广告源码不再影响你的网页加载速度
下一篇:Js 按照MVC模式制作自定义控件