📄 form.js
字号:
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.fixname; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' 只能为数字.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' 取值范围为 '+min+' 到 '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' 不能为空.\n'; }
} if (errors) alert('错误提示:\n'+errors);
document.MM_returnValue = (errors == '');
}
function GP_popupConfirmMsg(msg) { //v1.0-删除确认信息框
document.MM_returnValue = confirm(msg);}
if (top == self)top.location.href = "default.asp"; //禁止直接访问 [必须框架内才行]
//****************鼠标提示 开始*****************
var tPopWait=50; //停留tWait豪秒后显示提示
var tPopShow=6000; //显示tShow豪秒后关闭提示
var showPopStep=20;
var popOpacity=95;
var sPop=null;curShow=null;tFadeOut=null;tFadeIn=null;tFadeWaiting=null;
function showPopupText()
{
var o=event.srcElement;
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!="") { o.dypop=o.alt;o.alt=""; }
if(o.dypop!=sPop && o.dypop!="")
{
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="")
{
div_poplayer.innerHTML="";
div_poplayer.style.filter="Alpha()";
div_poplayer.filters.Alpha.opacity=0;
}
else
{
if(o.dyclass!=null) { popStyle=o.dyclass; }
else { popStyle="div_pop"; }
curShow=setTimeout("showIt()",tPopWait);
}
}
}
function showIt()
{
div_poplayer.className=popStyle;
div_poplayer.innerHTML=sPop;
popWidth=div_poplayer.clientWidth;
popHeight=div_poplayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) { popLeftAdjust=-popWidth-24; }
else { popLeftAdjust=0; }
if(MouseY+12+popHeight>document.body.clientHeight) { popTopAdjust=-popHeight-24; }
else { popTopAdjust=0; }
div_poplayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
div_poplayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
div_poplayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}
function fadeOut(){
if(div_poplayer.filters.Alpha.opacity<popOpacity)
{
div_poplayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else
{
div_poplayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}
function fadeIn()
{
if(div_poplayer.filters.Alpha.opacity>0)
{
div_poplayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.write("<div id='div_poplayer' style='position:absolute;z-index:1000;' class='div_pop'></div>");
document.onmouseover=showPopupText;
//****************鼠标提示 结束*****************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -