I just finished a project and was bored. I wanted to change my HomePage, but I didn't have the Asp permission. So I was surprised to use vbs to simulate an image paging display function! Because the write function is suitable for your use, it is inevitable that many places are not perfect! Please give me some comments when you pass by. If you want to find similar functions, you may be able to help. In addition, I wish every friend of the Forum a Happy New Year!
Copy codeThe Code is as follows: <script language = VBS>
Function showINDEXPAGE ()
JS = 1
WebPath = window. location
Do until Left (webPATH, 1) = "#" or JS = len (window. location)
JS = JS + 1
WebPATH = Right (window. location, JS)
Loop
If JS = len (window. location) then showINDEXPAGE = 1 else showINDEXPAGE = Replace (webPATH ,"#","")
END Function
QZ = "" 'prefix of the image file to be displayed
HZ = ". gif" 'Suffix of the image file to be displayed
TheMAX = 98 'maximum number of displayed images
TheSKIP = 5' number of images displayed per line
ThePAGE = 20' how many images are displayed per page
TheINDEX = int (theMAX/thePAGE)
If theMAX mod thePAGE <> 0 then theINDEX = theINDEX + 1
For I = 1 to theINDEX
ShowINDEX = "<a href = #" & I & "onclick = window. location. reload ()> "&" ["& I &"] "&" </a>"
Document. write showINDEX
Next
Document. write "<br>
If thePAGE = 0 then thePAGE = theMAX
For I = 1 to thePAGE
TheNUM = I + thePAGE * (showINDEXPAGE ()-1)
If theNum> theMAX then EXIT
If theNUM <10 then
Temp = " </img>"
Else if theNum <100 then
Temp = " </img>"
Else
Temp = " </img>"
End if
End if
Document. write temp
If theSKIP <> 0 then if I mod theSKIP = 0 then document. write "<br>"
Next
Document. write "For I = 1 to theINDEX
ShowINDEX = "<a href = #" & I & "onclick = window. location. reload ()> "&" ["& I &"] "&" </a>"
Document. write showINDEX
Next
</Script>