📄 jsfunction.js
字号:
//===========================================
//以下为分页代码
//============================================
//'-------------------------------------------------------------------------------------------------------------------------
//'例如:PageList(1,3,10,123,"acton=12",1)
//'页次:1/13页 每页:10篇 共:123篇 [1][2][3]...[13]
//'页次:当前第currentpag页,n 分隔数量;每页显示记录数:MaxRows,总记录数:CountNum,v为显示类型
//'-------------------------------------------------------------------------------------------------------------------------
function PageList(CurrentPage,n,MaxRows,CountNum,PageSearch,v,getdata)
{
var PageStr="";
//if (PageSearch!=''){
// PageSearch+="&";
//}
CountNum=parseInt(CountNum);
CurrentPage=parseInt(CurrentPage);
if (CountNum%MaxRows==0)
{
var Pagecount= parseInt(CountNum / MaxRows);
}
else
{
var Pagecount = parseInt(CountNum / MaxRows)+1;
}
if (Pagecount>CurrentPage+n)
{
var Endpage=CurrentPage+n;
}
else
{var Endpage=Pagecount;
}
var ShowPage;
switch (v)
{
case 1:
PageStr = SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,1);
ShowPage="<table border=\"0\" Style=\"width:100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
ShowPage+="<tr><td nowrap style=\"padding:0px;\">";
ShowPage+="页次:<b><font color=\"red\">"+CurrentPage+"<\/font><\/b>/<b>"+Pagecount+"</b>页";
ShowPage+=".每页:<b>"+MaxRows+"<\/b>条 共:<b>"+CountNum+"<\/b>条记录</td>";
ShowPage+="<td nowrap align=\"right\">分页:";
ShowPage+=PageStr;
ShowPage+="<\/td><td style=\"padding:0px;\" width=\"50\" noWrap align=\"right\"><input title=\"填写翻转的分页\" type=\"text\" name=\"GoPage\" size=\"4\" value=\""+CurrentPage+"\" onChange=\"GoToPage('"+PageSearch+"',''+this.value+'')\"><\/td><\/tr>";
ShowPage+="<\/table>";
break;
}
if (getdata)
{
return ShowPage;
}
else{
document.write (ShowPage);
}
}
function GoToPage(PageSearch,PageValue){
location.href=PageSearch+PageValue;
}
function SeachPage(CurrentPage,n,MaxRows,Endpage,Pagecount,PageSearch,v) {
var PageStr="";
switch (v)
{
case 1:
if (CurrentPage>n+1){PageStr="<a href=\""+PageSearch+"1\">[1]<\/a>...";}
for (var i=CurrentPage-n;i<=Endpage;i++)
{
if (i>=1)
{
if (i==CurrentPage)
{
PageStr+="<font color=\"Red\">[<b>"+i+"<\/b>]<\/font>";
}else{
PageStr+="<a href=\""+PageSearch+""+i+"\">["+i+"]<\/a>";
}
}
}
if (Pagecount>CurrentPage+n){PageStr+="...<a href=\""+PageSearch+""+Pagecount+"\">["+Pagecount+"]<\/a>";}
break;
}
return PageStr;
}
//===================================
//隐藏等待窗口
function h()
{
try{
parent.wf.innerHTML="";
}
catch(e)
{}
}
function w()
{
try{
parent.wf.innerHTML="<img src='images/loading.gif' border='0'>";
}
catch(e)
{}
}
//光标自动锁定查询框
function FocusKey()
{
var obj = document.Search.elements["sk"];
if (obj) {
if (obj.focus) { obj.focus(); }
}
}
//检测搜索框
function checkS()
{
try{
var s = document.Search.elements["sk"];
if (s.value=="")
{
alert("请输入要搜索的内容");
s.focus();
return false;
}
}
catch(e)
{}
}
//Index JavaScript
function goTO(u)
{
try{
if (u=="LG.asp?action=logout")
{
var lg = confirm("\nXMSky提示你:\n\n你确定要退出本系统吗?");
if (lg==true)
{
R.location.href=u;
}
}
else
{
R.location.href=u;
}
}
catch(e)
{
alert('主页中框架错误!')
}
}
function mOut(obj)
{
try{
obj.style.background='#f4f9fe';
}
catch(e){}
}
function mOver(obj)
{
try{
obj.style.background='#fff';
}
catch(e){}
}
//移动表格变色
function mU(obj)
{
try{
var oc = obj.style.background;
if (oc=="#f4f9fe")
{
obj.style.background=oc;
}
else
{
obj.style.background='#fff';
}
}
catch(e){}
}
function mV(obj)
{
try{
var oc = obj.style.background;
if (oc=="#f4f9fe")
{
obj.style.background=oc;
}
else
{
obj.style.background='#f5f5f5';
}
}
catch(e){}
}
function subMenu(menuID)
{
try{
var menuArray = new Array('menuXT','menuXJ','menuCJ')
for (i=0; i<menuArray.length; i++)
{
if (menuID==menuArray[i])
{
document.getElementById(menuArray[i]).style.display = '';
}
else
{
document.getElementById(menuArray[i]).style.display = 'none';
}
}
}
catch(e){}
}
function NewPopWindow(URLStr, wname, width, height, resize, status, scrol)
{
// if(NewPopWin)
// {
//if(!NewPopWin.closed) NewPopWin.close();
// }
NewPopWin = open(URLStr,wname,'toolbar=no,location=no,directories=no,status='+status+',menubar=no,scrollbars='+scrol+',resizable='+resize+',copyhistory=no,width='+width+',height='+height+',left='+(window.screen.width-width)/2+',top='+(window.screen.height-height)/2+',screenX='+(window.screen.width-width)/2+',screenY='+(window.screen.height-height)/2+'');
NewPopWin.focus();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -