网站首页  注册会员  本站免费电影 留言板  繁體中文

 

您现在的位置: 陈鹏个人网站 >> 电脑应用 >> 网络应用 >> 网页制作 >> 正文
 

   
专 题 栏 目
相 关 文 章

恢复Windows 7和Xp双启动
把重要的Word 2003文档放
FIF教程:菜单概述(下)
FIF教程:菜单概述(上)
网页菜单,让你的网站更
Dreamweaver下拉菜单全攻
用DW MX控制下拉菜单精确
动手制作Dreamweaver活动
Dreamweaver滑动菜单的制
用Dreamweaver制作导航下

 
下拉菜单做翻页的通用代码!           
下拉菜单做翻页的通用代码!
作者:陈鹏 文章来源:eNet 点击数: 更新时间:2009-9-12 8:44:35
 




 

<P>    其实这个代码就是老外的那个翻页插件,后来是哪位好朋友(不好意思,忘了)修改后放在论坛上的,我还做成过插件,其实光是拷贝也挺方便的。<BR>    还有最后一段是前后翻页的按钮,呵呵,这个还是ccjat提醒后加上的,用不用都随便咯。 <BR><%<BR>记录集名字_total = 记录集名字.RecordCount</P> <P>If (记录集名字_numRows < 0) Then<BR>记录集名字_numRows = 记录集名字_total<BR>Elseif (记录集名字_numRows = 0) Then<BR>记录集名字_numRows = 1<BR>End If</P> <P>记录集名字_first = 1<BR>记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1</P> <P>If (记录集名字_total <> -1) Then<BR>If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total<BR>If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total<BR>If (记录集名字_numRows > 记录集名字_total) Then 记录集名字_numRows = 记录集名字_total<BR>End If<BR>%><BR><%</P> <P>If (记录集名字_total = -1) Then</P> <P>记录集名字_total=0<BR>While (Not 记录集名字.EOF)<BR>记录集名字_total = 记录集名字_total + 1<BR>记录集名字.MoveNext<BR>Wend</P> <P>If (记录集名字.CursorType > 0) Then<BR>记录集名字.MoveFirst<BR>Else<BR>记录集名字.Requery<BR>End If</P> <P>If (记录集名字_numRows < 0 Or 记录集名字_numRows > 记录集名字_total) Then<BR>记录集名字_numRows = 记录集名字_total<BR>End If</P> <P>记录集名字_first = 1<BR>记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1<BR>If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total<BR>If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total</P> <P>End If<BR>%><BR><%<BR>Set MM_rs = 记录集名字<BR>MM_rsCount = 记录集名字_total<BR>MM_size = 记录集名字_numRows<BR>MM_uniqueCol = ""<BR>MM_paramName = ""<BR>MM_offset = 0<BR>MM_atTotal = false<BR>MM_paramIsDefined = false<BR>If (MM_paramName <> "") Then<BR>MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")<BR>End If<BR>%></P> <P><%<BR>if (Not MM_paramIsDefined And MM_rsCount <> 0) then</P> <P>r = Request.QueryString("index")<BR>If r = "" Then r = Request.QueryString("offset")<BR>If r <> "" Then MM_offset = Int(r)</P> <P><BR><%</P> <P>MM_removeList = "&index="<BR>If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="<BR>MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""</P> <P>For Each Item In Request.QueryString<BR>NextItem = "&" & Item & "="<BR>If (InStr(1,MM_removeList,NextItem,1) = 0) Then<BR>MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))<BR>End If<BR>Next</P> <P>For Each Item In Request.Form<BR>NextItem = "&" & Item & "="<BR>If (InStr(1,MM_removeList,NextItem,1) = 0) Then<BR>MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))<BR>End If<BR>Next</P> <P>MM_keepBoth = MM_keepURL & MM_keepForm<BR>if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)<BR>if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)<BR>if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)</P> <P>Function MM_joinChar(firstItem)<BR>If (firstItem <> "") Then<BR>MM_joinChar = "&"<BR>Else<BR>MM_joinChar = ""<BR>End If<BR>End Function<BR>%><BR><%<BR>MM_keepMove = MM_keepBoth<BR>MM_moveParam = "index"</P> <P>If (MM_size > 0) Then<BR>MM_moveParam = "offset"<BR>If (MM_keepMove <> "") Then<BR>params = Split(MM_keepMove, "&")<BR>MM_keepMove = ""<BR>For i = 0 To UBound(params)<BR>nextItem = Left(params(i), InStr(params(i),"=") - 1)<BR>If (StrComp(nextItem,MM_moveParam,1) <> 0) Then<BR>MM_keepMove = MM_keepMove & "&" & params(i)<BR>End If<BR>Next<BR>If (MM_keepMove <> "") Then<BR>MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)<BR>End If<BR>End If<BR>End If</P> <P>If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"<BR>urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="<BR>MM_moveFirst = urlStr & "0"<BR>MM_moveLast = urlStr & "-1"<BR>MM_moveNext = urlStr & Cstr(MM_offset + MM_size)<BR>prev = MM_offset - MM_size<BR>If (prev < 0) Then prev = 0<BR>MM_movePrev = urlStr & Cstr(prev)<BR>%><BR><script language="JavaScript"><BR>function jumpage(selObj,restore){<BR>eval("location='"+selObj.options[selObj.selectedIndex].value+"'");<BR>if (restore) selObj.selectedIndex=0;}<BR></script></P> <P><select name="pages" size=1 onChange="jumpage(this,0)" class="txtfld"><BR><%<BR>TM_counter = 0<BR>For i = 1 to 记录集名字_total Step MM_size<BR>TM_counter = TM_counter + 1<BR>TM_PageEndCount = i + MM_size - 1<BR>if TM_PageEndCount > 记录集名字_total Then TM_PageEndCount = 记录集名字_total<BR>if i <> MM_offset + 1 then<BR>%><BR><option value="<%=Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 %>"> <BR>第 <%= TM_counter %> 页</option><BR><% else %><BR><option selected>第 <%=TM_counter%> 页</option><BR><% End if %><BR><% next %><BR></select><BR><input type="button" class="INPUT" onclick="location.href='<%=MM_movePrev%>'" value=" " style="FONT-FAMILY: 'Wingdings 3'" <% If MM_offset <> 0 Then <BR>response.write ""<BR>else <BR>response.write "disabled"<BR>end if %>><BR><input type="button" class="INPUT" onclick="location.href='<%=MM_moveNext%>'" value="}" style="FONT-FAMILY: 'Wingdings 3'" <% If Not MM_atTotal Then<BR>response.write ""<BR>else <BR>response.write "disabled"<BR>end if %>></P>

文章录入:陈鹏    责任编辑:陈鹏 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     
     
     
     
     

    Copyright © 2007 - 2009 chenpeng123.com All Rights Reserved
    本站所有文章,软件等均来自网络收集,不代表本站观点,仅供学习和研究使用。如有侵犯您的版权,请联系我们,本站将立即删除。
    鲁ICP备07014697号
    你是本站第 位访客