⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpernou.asp

📁 较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
response.Buffer=true
sqlnum="select * from titletable order by id asc"
set rstitle=server.CreateObject("adodb.recordset")
rstitle.open sqlnum,conn,1,1
hg=22  'head height; No raise
bhg=252   'bodyheight; Can raise
mnum=rstitle.recordcount    'menuitem;   Can raise
'rsnum.close
'set rsnum=nothing
%>
<HTML><HEAD><TITLE>菜单</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="Microsoft FrontPage 5.0" name=GENERATOR>

<STYLE>
.headtd1 {
	BORDER-RIGHT: #0077ff 2px outset; BORDER-TOP: #00bbff 2px outset; FONT-SIZE: 9pt; BACKGROUND: #00a4e1; BORDER-LEFT: #00bbff 2px outset; CURSOR: hand; BORDER-BOTTOM: #0077ff 2px outset
}
.headtd2 {
	BORDER-RIGHT: #0077ff 2px outset; BORDER-TOP: #60d3ff 2px outset; FONT-SIZE: 9pt; BACKGROUND: #20c1ff; BORDER-LEFT: #60d3ff 2px outset; CURSOR: default; BORDER-BOTTOM: #0077ff 2px outset
}
.bodytd {
	BORDER-RIGHT: #0077ff 2px outset; BORDER-TOP: #b0d8ff 2px outset; FONT-SIZE: 9pt; BACKGROUND: #99ccff; BORDER-LEFT: #b0d8ff 2px outset; BORDER-BOTTOM: #0077ff 2px outset
}
TD {
	FONT-SIZE: 9pt
}
A {
	FONT-SIZE: 9pt; COLOR: #0066cc; TEXT-DECORATION: none
}
A:hover {
	FONT-SIZE: 9pt; COLOR: #990000
}
.LeftNavUp {
	 border: 3px outset #00FFFF;  padding-left:3; padding-right:4; padding-top:3; padding-bottom:2;background-color:#CCCCFF 
}
.LeftNavOff {

}
</STYLE>
<SCRIPT language=JavaScript>
<!-- begin
var headHeight =<%=hg%>;     /* 22*/
var bodyHeight =<%=bhg%>; /* 202*/
var objcount =<%=mnum%>;
var step = 10;
var moving = false;
function showme(obj1, obj2)
{
	if (moving)
		return;
	moving = true;
	for(i=0;i<document.all.tags('td').length;i++)
		if (document.all.tags('td')[i].className.indexOf('headtd') == 0)
			document.all.tags('td')[i].className = 'headtd1';
	obj2.className = 'headtd2';
	moveme(obj1);
}
function moveme(obj)
{
	idnumber = parseInt(obj.id.substr(4));
	objtop = headHeight * (idnumber - 1);
	objbuttom = bodyHeight + headHeight * (idnumber - 2);
	currenttop = parseInt(obj.style.top);
	if (currenttop >= objbuttom)
	{
		countid = 1;
		for(i=0;i<document.all.tags('div').length;i++)
			if (document.all.tags('div')[i].id == 'item'+countid+'body')
			{
				obj = document.all.tags('div')[i];
				objtop = headHeight * (countid - 1);
				if (countid == idnumber)
				{
					moveup(obj,objtop,false);
					break;
				}
				else
					moveup(obj,objtop,true);
				countid++;
			}
	}
	else if ((currenttop <= objtop) && (idnumber < objcount))
	{
		idnumber++;
		countid = objcount;
		for(i=document.all.tags('div').length-1;i>=0;i--)
			if (document.all.tags('div')[i].id == 'item'+countid+'body')
			{
				obj = document.all.tags('div')[i];
				objbuttom = bodyHeight + headHeight * (countid - 2);
				if (countid == idnumber)
				{
					movedown(obj,objbuttom,false);
					break;
				}
				else
					movedown(obj,objbuttom,true);
				countid--;
			}
	}
}
function moveup(obj,objtop,ismove)
{
	currenttop = parseInt(obj.style.top);
	if (currenttop > objtop)
	{
		obj.style.top = currenttop - step;
		setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1)
		return;
	}
	moving = ismove;
}
function movedown(obj,objbuttom,ismove)
{
	currenttop = parseInt(obj.style.top);
	if (currenttop < objbuttom)
	{
		obj.style.top = currenttop + step;
		setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1)
		return;
	}
	moving = ismove;
}

function subckhg(){
var mr=document.body.clientHeight;
var km1s=<%=(hg-1)*mnum+bhg%>;
if (mr<km1s)
    {
	//window.moveTo(0,0);
	window.parent.moveTo(0,0);
	sx=screen.availWidth; 
    sy=screen.availHeight; 
    //window.resizeTo(sx,sy);
	window.parent.resizeTo(sx,sy);
	yyb2.style.height=0;
	}
else
   {
var kr=mr-km1s+13;
yyb2.style.height=kr;
   }
setTimeout("subckhg();",900);   	
}
//end -->
</SCRIPT>

</HEAD>
<BODY onLoad="javascript:subckhg();" bgColor=#333366 text=#000000 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false;">
<%
response.Write "<DIV id=mainboard style='Z-INDEX:1; BACKGROUND: #99ccff; LEFT: 2px; OVERFLOW: hidden; WIDTH: 120px; POSITION: absolute; TOP: 2px; HEIGHT:"&bhg+hg*(mnum-1)&"px'>"&chr(13)
for wnum=1 to mnum
response.Write "<DIV id=item"&wnum&"body style='Z-INDEX:"&wnum+1&"; LEFT: 0px; OVERFLOW: hidden; WIDTH: 120px; POSITION: absolute; TOP:"
        if wnum=1 then
		   response.write "0"
        else
		   response.write bhg+hg*(wnum-2)		   
        end if		   
response.Write "px; HEIGHT:"&bhg&"px'>"&chr(13)&_  
		       "<TABLE height='100%' cellSpacing=0 cellPadding=2 width='100%' border=0>"&chr(13)&_
			   "<TR><TD class=headtd1 id=item"&wnum&"head onclick=showme(item"&wnum&"body,this) align=middle height=20>"&rstitle("mtitle")&"</TD></TR>"&chr(13)&_
			   "<TR><TD class=bodytd align=middle>"&chr(13)
			   subtable(rstitle("id"))
response.Write "</TD></TR></TABLE></DIV>"&chr(13) 
rstitle.movenext
next
response.Write "</DIV>"
rstitle.close
set rstitle=nothing
conn.close
set conn=nothing
%>
<DIV id=yyb2 style="Z-INDEX: 95; LEFT: 2px; OVERFLOW: hidden; WIDTH: 120px; POSITION: absolute; TOP: <%=bhg+hg*(mnum-1)+2%>px; HEIGHT:262px">
<TABLE height="100%" cellSpacing=0 cellPadding=2 width="100%" border=0 style="padding:3; border:2px outset #3399FF; background-color: #0066AA; color:#111111">
<TR><TD align=middle  height=20>
<script>
<!-- begin
function Year_Month(){  
    var now = new Date();  
    var yy = now.getYear();  
    var mm = now.getMonth()+1;  
    var cl = '<font color="#0000df">';  
    if (now.getDay() == 0) cl = '<font color="#c00000">';  
    if (now.getDay() == 6) cl = '<font color="#00c000">';  
    return(cl +  yy + '年' + mm + '月</font>'); } 
 function Date_of_Today(){  
    var now = new Date();  
    var cl = '<font color="#ff0000">';  
    if (now.getDay() == 0) cl = '<font color="#c00000">';  
    if (now.getDay() == 6) cl = '<font color="#00c000">';  
    return(cl +  now.getDate() + '</font>'); } 
 function Day_of_Today(){  
    var day = new Array();  
    day[0] = "星期日";  
    day[1] = "星期一";  
    day[2] = "星期二";  
    day[3] = "星期三";  
    day[4] = "星期四";  
    day[5] = "星期五";  
    day[6] = "星期六";  
    var now = new Date();  
    var cl = '<font color="#0000df">';  
    if (now.getDay() == 0) cl = '<font color="#c00000">';  
    if (now.getDay() == 6) cl = '<font color="#00c000">';  
    return(cl +  day[now.getDay()] + '</font>'); } 
  
document.write(Year_Month());  
document.write(Date_of_Today());  
document.write(Day_of_Today());  
//end -->
</script>
</TD></TR>
</TABLE></DIV>
</BODY>
</HTML>
<%
sub subtable(dnum)
if not isnumeric(dnum) then
  response.Write "没有此项数据"
else
   set srs=conn.execute("select * from linkobjtable where TTnum="&dnum&" order by id asc")
   response.Write "<TABLE height='100%' cellSpacing=1 cellPadding=1 width='99%' border=0>"
   do while not srs.eof 
   a1=srs("smlink")
   a2=srs("smtarget")
   a3=srs("smdescription")
   a4=srs("smtitle")
   response.Write "<TR><TD align=middle bgColor=#d9ecff onmouseover="&chr(34)&"this.className='LeftNavUp';window.status='"&a3&_
                  "'"&chr(34)&" onmouseout="&chr(34)&" this.className='LeftNavOff'"&chr(34)&">"&_
                  "<a href='"&a1&"' target='"&a2&"' onmousemove="&chr(34)&"window.status='"&a3&"'"&chr(34)&" onmouseout="&chr(34)&"window.status=''"&chr(34)&">"&a4&"</a>"&_       
                  "</TD></TR>"				  
   srs.movenext 		  				  
   loop
   response.Write "</TABLE>"
   set srs=nothing
end if
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -