js+Css实现的一个简单对话框
2011-09-21 16:47
671 查看
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提示信息框</title>
<style type="text/css">
a{ color:#000; font-size:12px;text-decoration:none}
a:hover{ color:#900; text-decoration:underline}
body{background:;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#003366); overflow:hidden}
#massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}
#mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}
.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
</style>
<!--实现层移动-->
<script language="javascript">
var Obj = ''
document.onmouseup = MUp
document.onmousemove = MMove
function MDown(Object) {
Obj = Object.id
document.all(Obj).setCapture()
pX = event.x - document.all(Obj).style.pixelLeft;
pY = event.y - document.all(Obj).style.pixelTop;
}
function MMove() {
if (Obj != '') {
document.all(Obj).style.left = event.x - pX;
document.all(Obj).style.top = event.y - pY;
}
}
function MUp() {
if (Obj != '') {
document.all(Obj).releaseCapture();
Obj = '';
}
}
</script>
</head>
<body>
<div id="massage_box">
<div class="massage">
<div class="header" onmousedown="MDown(massage_box)">
<div style="display: inline; width: 150px; position: absolute">
本站提示信息
</div>
<span onclick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'"
style="float: right; display: inline; cursor: hand">×</span></div>
<ul style="margin-right: 25">
<li>本人申明此博客所有文章(包括文章插图)均为原创,如需引用或转载请注明出处。 </li>
<li>欢迎大家对博文中观点留言评述,谢绝无聊人士无素质无观点的灌水漫骂。</li><li>本站已设背景音乐,听音乐盒中收集的音乐时请先到页面底部关闭背景音乐。</li></ul>
</div>
</div>
<div id="mask">
</div>
<span onclick="mask.style.visibility='visible';massage_box.style.visibility='visible'"
style="cursor: hand"><a href="#">显示提示信息</a></span>
bottom here
</body>
</html>
相关文章推荐
- 用html+css+js实现的一个简单的图片切换特效
- 用html+css+js实现的一个简单的图片切换特效
- css+js实现一个弹出层,完成注册功能 带有遮罩层,比较简单
- js实现的简单模态对话框
- CSS+HTML+JS实现的的一个树
- 一个简单的js实现倒计时函数
- js 简单实现 弹出确认 取消对话框
- 你知道的,javascript语言的执行环境是"单线程模式",这种模式的好处是实现起来比较简单,执行环境相对单纯;坏处是只要有一个任务耗时很长,后面的任务都必须排队等着,会拖延整个程序的执行,因此很多时候需要进行“异步模式”,请列举js异步编程的方法。
- JS+CSS简单实现DIV遮罩层显示隐藏
- 简单JS+CSS实现仿流行的LED跑马灯效果,超逼真
- JS实现一个简单的计算器
- 利用Activity实现一个简单的可输入对话框
- node.js 实现一个简单的登录拦截器
- 一个有趣的例子,JS+CSS实现【兴趣是最好的老师】
- 一个简单的js脚本实现表格排序
- 一个简单的jQuery插件ajaxfileupload.js实现ajax上传文件例子
- js+css简单实现网页换肤效果
- css + js实现简单无缝滚动字幕
- JS+CSS实现一个气泡提示框
- 用html+css+jQuery实现的一个简单的图片切换特效