易截截图软件、单文件、免安装、纯绿色、仅160KB

锁屏JavaScript片段

var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function cloDiv(){
var overlayID="overlay";
var msgID = "overlayMsg";
document.body.removeChild(docEle(overlayID));
document.body.removeChild(docEle(msgID));
}
function openNewDiv() {

var overlayID="overlay";
var msgID = "overlayMsg";
if (docEle(overlayID)) document.removeChild(docEle(overlayID));
if (docEle(msgID)) document.removeChild(docEle(msgID));
// 消息显示
var newDiv = document.createElement("div");
newDiv.id = msgID;
newDiv.style.position = "absolute";
newDiv.style.zIndex = "999";
newDiv.style.width = "200px";
newDiv.style.height = "30px";
var scrolltop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;

var _clientheight=0;
//ie FF 在有DOCTYPE时各有区别
_clientheight = Math.min(document.body.clientHeight , document.documentElement.clientHeight);
if(_clientheight==0)
_clientheight= Math.max(document.body.clientHeight , document.documentElement.clientHeight);

var _clientwidth= document.documentElement.clientWidth || document.body.clientWidth;
//整个页面的高度
var _pageheight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);

var msgtop = (scrolltop+((_clientheight)/2)+100)+"px";
var msgleft = (_clientwidth-200)/2+"px";
newDiv.style.top = msgtop;
newDiv.style.left =msgleft; // 屏幕居中
newDiv.style.background = "#CDCDCD";
newDiv.style.border = "1px solid #EFEFEF";
newDiv.style.padding = "5px";
newDiv.innerHTML = "正在获取Config,请稍等...";
document.body.appendChild(newDiv);
// 锁屏图层
var newMask = document.createElement("div");
newMask.id = overlayID;
newMask.style.position = "absolute";
newMask.style.zIndex = "998";
newMask.style.width = _clientwidth + "px";
newMask.sty


相关文档:

[JavaScript]使Firefox支持innerText

innerText是ie的私有属性,firefox的类似属性为textContent,如果在网页中使用innerText的话,需要用一个条件判断来查看浏览器支持哪种属性。这里我们可以为firefox定义一个innerText使得在正文代码中只需要用innerText而非一个函数,可使代码变得更直观简洁。
var lBrowser = {};
lBrowser.agt = navigator.userAgent.t ......

JavaScript控制CheckBoxList单选两种方法

方法1:
 1function   CheckSelect()
 2 {  
 3    var tb = document.getElementById("ctl00_ContentPlaceHolder1_chkYear"); 
 4
 5    for(var i=0;i < tb.rows.length;i+ ......

Javascript怎么在两个窗体之间传值

原文:刘武|Javascript怎么在两个窗体之间传值  
众所周知window.open() 函数可以用来打开一个新窗口,那么如何在子窗体中向父窗体传值呢,其实通过window.opener即可获取父窗体的引用。
如我们新建窗体FatherPage.htm:
XML-Code:
<script type="text/javascript">
function OpenChildWindow()
{ ......

javascript实现对文件上传类型的限制

注: http://www.java114.com/277/content4355.html
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> upload </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME ......

JavaScript 如何弹出一个对话框窗口

//定义要打开的对话框页面的地址 一般用action跳转要写明action的地址,如果需要参数,则在后面拼接
var urlDialog = "grpBlackWhiteManageAction.do?act=choiceMessageModel&GrpBWhiteListLevel=0";
//定义要弹出的对话框的模式,dialogWidth宽,dialogHeight高 等等
 var style = "dialogWidth=600px;dialogH ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号