晕,没看懂!LZ 把代码贴出来,然后把需求一条一条讲清楚!
1
2
3
4
1
2
3
4
解决方案 »
- 同时提交两个表单,一个上传图片,另一个提交图片名称,点击一个submit按钮一同执行
- JavaScript 的replace正则问题 在线等
- xheditor怎样设置跨域上传呢
- 如何整合jquery fullcalendar到php网站
- js 总是获得不到frame对象或者frameset对象,请教??
- javascript 输出特殊字符
- 50分求助window.open的问题,关于爷爷窗口的刷新,多谢了!
- 请教,如何在网页加载时设置表单内除按钮外的所有元素的readonly=true
- 如何自行编程处理表单并保存入数据库?
- 正则表达式js
- javaScript 的typeof 是做什么的,麻烦告诉我谢谢
- 如何判断现在的焦点没有在任何文本框上面,也不在radio上,最好能判断不在任何表单元素上
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>全屏DIV</title>
<style type="text/css">
html, body {
height:100%;
width:100%;
padding:0px;
margin:0px;
}div.AllWindowDiv {
position:absolute;
z-index:100;
width:100%;
height:100%;
opacity:0.5;
filter:alpha(opacity=50);
background-color:#000000;
}
</style>
<script type="text/javascript">
var Class = {
//创建类
create: function () {
return function () {
this.initialize.apply(this, arguments);
};
}
};var $A = function (a) {
//转换数组
return a ? Array.apply(null, a) : new Array;
};var $ = function (id) {
//获取对象
return document.getElementById(id);
};Object.extend = function (a, b) {
//追加方法
for (var i in b) a[i] = b[i];
return a;
};Object.extend(Object, { addEvent : function (a, b, c, d) {
//添加函数
if (a.attachEvent) a.attachEvent(b[0], c);
else a.addEventListener(b[1] || b[0].replace(/^on/, ""), c, d || false);
return c;
},
delEvent : function (a, b, c, d) {
if (a.detachEvent) a.detachEvent(b[0], c);
else a.removeEventListener(b[1] || b[0].replace(/^on/, ""), c, d || false);
return c;
},
reEvent : function () {
//获取Event
return window.event ? window.event : (function (o) {
do {
o = o.caller;
} while (o && !/^\[object[ A-Za-z]*Event\]$/.test(o.arguments[0]));
return o.arguments[0];
})(this.reEvent);
}
});Function.prototype.bind = function () {
//绑定事件
var wc = this, a = $A(arguments), o = a.shift();
return function () {
wc.apply(o, a.concat($A(arguments)));
};
};var ScreenDiv = Class.create();ScreenDiv.prototype = {
initialize : function () {
var wc = this, div = wc.div;
div.setAttribute(/MSIE/.test(window.navigator.userAgent) ? "className" : "class", "AllWindowDiv");
div.onclick = wc.clear.bind(wc);
},
div : document.createElement("div"),
rePosition : function () {
return { x : document.documentElement.scrollLeft, y : document.documentElement.scrollTop };
},
add : function () {
var wc = this, p = wc.rePosition();
with (wc.div.style) {
left = p.x + "px";
top = p.y + "px";
}
document.body.appendChild(wc.div);
document.onselectstart = new Function("return false");
document.getElementsByTagName("html")[0].style.overflow = "hidden";
window.scrollTo(p.x, p.y);
},
clear : function () {
var wc = this;
document.body.removeChild(wc.div);
document.onselectstart = null;
document.getElementsByTagName("html")[0].style.overflow = "";
}
};var $ScreenDiv = new ScreenDiv;
</script>
</head>
<body>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<input type="button" value="全平显示" onclick="$ScreenDiv.add()" />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</body>
</html>