📄 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 closeLeft()
{
try{
var obj = document.getElementById('closeleft');
var cleft = document.getElementById('leftFace');
if(cleft.style.display == 'none'){
cleft.style.display = '';
obj.innerHTML = "<span title='关闭左侧菜单'><<</span>";
}else{
cleft.style.display = 'none';
obj.innerHTML = "<span title='打开左侧菜单'>>></span>";
}
}
catch(e){}
}
function subMenu(menuID)
{
try{
var obj = document.getElementById(menuID);
if (obj.style.display == 'none')
{
obj.style.display = '';
if (menuID == 'menuXJ')
{
document.getElementById('menuCJ').style.display='none';
}
else
{
document.getElementById('menuXJ').style.display='none';
}
}
else
{
obj.style.display = 'none';
}
}
catch(e){}
}
function sbi(sobj)
{
try{
var sv = sobj.options[sobj.selectedIndex].value;
if (sv!="")
{
writeCookie("sbj",sv,24);
document.body.style.backgroundImage="url('images/bg/"+sv+".jpg')";
window.frames["R"].document.body.style.backgroundImage="url('images/bg/"+sv+"-1.jpg')";
document.all.wf.innerHTML="<img src='images/loading.gif' border='0'>";
loadCheck();
}
}
catch(e){}
}
function loadCheck() {
var bool = window.frames["R"].document.readyState;
if (bool!="complete") {
setTimeout('loadCheck()', 1);
} else {
document.all.wf.innerHTML="";
}
}
function getBJ(bType)
{
try{
var sb = readCookie("sbj");
if (sb == null||sb == "")
{
//默认背景ID
sb = 9;
}
if (bType == "Index")
{
getIndex();
document.body.style.backgroundImage="url('images/bg/"+sb+".jpg')";
}
else
{
document.body.style.backgroundImage="url('images/bg/"+sb+"-1.jpg')";
}
}
catch(e){}
}
function getIndex()
{
try{
var sb = readCookie("sbj");
if (sb == null||sb == "")
{
sb = 9;
}
document.all.bjs.selectedIndex=sb;
document.all.wf.innerHTML="<img src='images/loading.gif' border='0'>";
loadCheck();
}
catch(e){}
}
// writeCookie
function writeCookie(name, value, expires)
{
try{
var expire = "";
if(expires != null)
{
expire = new Date((new Date()).getTime() + expires * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}
catch(e){}
}
//readCookie
function readCookie(name)
{
try{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
catch(e){}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -