请高人给个控制DIV的代码。要求(透明、定时关闭) http://shunde.houseb2b.net/member2/add_land.html参考吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 基于prototype.js到处都有可以去下.如果不用就抽取需要的部分出来就可以了。==============================================================================<!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>div demo</title><style>body { width:1000px; height:480px;}#demo { position:absolute; width:200px; height:200px; border:1px solid black; background-color:#CCCCCC; text-align:center; left:50%; top:50%; margin:-100px 0px 0px -100px; filter:alpha(opacity=50); moz-opacity:0.5; opacity:0.5;}#demo #close { position:relative; width:20px; height:20px; border:1px solid black; background-color:#CCCCCC; text-align:center; line-height:20px; float:right; margin:1px 1px 0px 0px; cursor:pointer;}#demo #close:hover { background-color:#666666; color:#FFFFFF;}</style><script type="text/javascript" src="/script/prototype.js"></script><script type="text/javascript">var dWin = Class.create();dWin.prototype = { initialize:function(element){ this.mainWindow = element; this.mainWindow.style.display = "none"; }, show:function(autoHide,seconds){ this.mainWindow.style.display = ""; if(autoHide){ window.setTimeout(this.hide.bind(this),seconds*1000); } }, hide:function(){ this.mainWindow.style.display = "none"; }}window.onload = function(){ window.dWin = new dWin(document.getElementById("demo")); document.getElementById("show").onclick = window.dWin.show.bind(window.dWin,1,5); document.getElementById("close").onclick = window.dWin.hide.bind(window.dWin);}</script></head><body><div id="show"> <a href="#" onclick="return false">show window</a></div><div id="demo" style="display:none;"> <div id="close">X</div></div></body></html> 谷歌、火狐下js不能动态创建元素。急!!! 求网站常用JS特效展示或代码!!! 望指教一下jquery的each问题 求一个正则 怎样移动文本框的焦点到末尾? 怎么判断传入的页面? 请教大家一个JS日期排序问题。 问一个JQ.Ajax()的问题,希望大牛们帮助帮助。 ckeditor和ckfinder组合的问题 什么样的浏览器,可以屏蔽javascript ? 在哪里屏蔽? css控制如何控制同名class表格(非行)背景颜色交替变化 用Embed播放的Flash为什么总是在最前面,用DIV的z-index=99999也盖不住它
==============================================================================<!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>div demo</title>
<style>
body {
width:1000px;
height:480px;
}#demo {
position:absolute;
width:200px;
height:200px;
border:1px solid black;
background-color:#CCCCCC;
text-align:center;
left:50%;
top:50%;
margin:-100px 0px 0px -100px;
filter:alpha(opacity=50);
moz-opacity:0.5;
opacity:0.5;
}#demo #close {
position:relative;
width:20px;
height:20px;
border:1px solid black;
background-color:#CCCCCC;
text-align:center;
line-height:20px;
float:right;
margin:1px 1px 0px 0px;
cursor:pointer;
}
#demo #close:hover {
background-color:#666666;
color:#FFFFFF;
}
</style>
<script type="text/javascript" src="/script/prototype.js"></script>
<script type="text/javascript">
var dWin = Class.create();
dWin.prototype = {
initialize:function(element){
this.mainWindow = element;
this.mainWindow.style.display = "none";
},
show:function(autoHide,seconds){
this.mainWindow.style.display = "";
if(autoHide){
window.setTimeout(this.hide.bind(this),seconds*1000);
}
},
hide:function(){
this.mainWindow.style.display = "none";
}
}window.onload = function(){
window.dWin = new dWin(document.getElementById("demo"));
document.getElementById("show").onclick = window.dWin.show.bind(window.dWin,1,5);
document.getElementById("close").onclick = window.dWin.hide.bind(window.dWin);
}
</script>
</head><body>
<div id="show">
<a href="#" onclick="return false">show window</a>
</div>
<div id="demo" style="display:none;">
<div id="close">X</div>
</div>
</body>
</html>