当前位置导航:炫浪网>>网络学院>>网页制作>>JavaScript教程

下拉菜单做翻页的通用代码

 

这是一个用下拉菜单来做翻页的通用代码,我觉得这样做比较省空间,蛮好的
其实这个代码就是老外的那个翻页插件,后来是哪位好朋友(不好意思,忘了)修改后放在论坛上的,我还做成过插件,其实光是拷贝也挺方便的。
还有最后一段是前后翻页的按钮,呵呵,这个还是ccjat提醒后加上的,用不用都随便咯。

<%
记录集名字_total = 记录集名字.RecordCount

If (记录集名字_numRows < 0) Then
记录集名字_numRows = 记录集名字_total
Elseif (记录集名字_numRows = 0) Then
记录集名字_numRows = 1
End If

记录集名字_first = 1
记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1

If (记录集名字_total <> -1) Then
If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total
If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total
If (记录集名字_numRows > 记录集名字_total) Then 记录集名字_numRows = 记录集名字_total
End If
%>
<%

If (记录集名字_total = -1) Then

记录集名字_total=0
While (Not 记录集名字.EOF)
记录集名字_total = 记录集名字_total + 1
记录集名字.MoveNext
Wend

If (记录集名字.CursorType > 0) Then
记录集名字.MoveFirst
Else
记录集名字.Requery
End If

If (记录集名字_numRows < 0 Or 记录集名字_numRows > 记录集名字_total) Then
记录集名字_numRows = 记录集名字_total
End If

记录集名字_first = 1
记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1
If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total
If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total

End If
%>
<%
Set MM_rs = 记录集名字
MM_rsCount = 记录集名字_total
MM_size = 记录集名字_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>

<%
if (Not MM_paramIsDefined And MM_rsCount <> 0) then

r = Request.QueryString("index")
If r = "" Then r = Request.QueryString("offset")
If r <> "" Then MM_offset = Int(r)

相关内容
赞助商链接