查看: 10961|回复: 0
打印 上一主题 下一主题

js弹出alert对话框效果代码

[复制链接]
跳转到指定楼层
1#
发表于 2009-7-24 13:33:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
台州网址导航
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js弹出alert对话框效果代码T</title>
<style>
*{ padding:0; margin:0; font-size:12px;}
#bg{background:#000000;opacity: 0.5;-moz-opacity:0.5; filter:alpha(opacity=50); width:100%; height:100%;position:absolute; top:0; left:0}
#info{height:0px; width:0px;top:50%; left:50%;position:absolute;  line-height:1.7}
#center{background:#fff;border:1px solid #217AC1; width:300px; height:100px; position:absolute; margin:-50px -150px;}
#center strong{ display:block; padding:2px 5px; background:#EBF4FC; color:#519FEE;}
#center p{padding:10px; text-align:center; color:#1C6FB8;}
</style>
</head>
<body>
<span id="boxs"></span>
<a href="javascript:boxs(1);">点这里</a>
<script>
function boxs(v){
window.scrollTo(0,0);
var bo = document.getElementsByTagName('body')[0];
var ht = document.getElementsByTagName('html')[0];
var boht = document.getElementById('boxs');   
boht.innerHTML = '';
bo.style.height='auto';
bo.style.overflow='auto';
ht.style.height='auto';
if(v == 1){   
  bo.style.height='100%';
  bo.style.overflow='hidden';
  ht.style.height='100%';  
  boht.innerHTML = '<div id="bg"></div><div id="info"><div id="center"><strong>友情提醒:</strong><p><a href="javascript:boxs(0);">关闭</a></p></div></div>';   
}
}
</script>
</body>
</html>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖
台州维博网络(www.tzweb.com)专门运用PHP+MYSQL/ASP.NET+MSSQL技术开发网站门户平台系统等。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

网站推广
关于我们
  • 台州朗动科技(Tzweb.com)拥有多年开发网站平台系统门户手机客户端等业务的成功经验。主要从事:政企网站,系统平台,微信公众号,各类小程序,手机APP客户端,浙里办微应用,浙政钉微应用、主机域名、虚拟空间、后期维护等服务,满足不同企业公司的需求,是台州地区领先的网络技术服务商!

Hi,扫描关注我

Copyright © 2005-2026 站长论坛 All rights reserved

Powered by 站长论坛 with TZWEB Update Techonolgy Support

快速回复 返回顶部 返回列表