| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP menu help
How do I transform this horizontal menu into a vertical one?
<-------Horizontal menu --------------> <%Sub DrawNavigation (aLinks,aLinksHREF)%> <table border=0 bgcolor=#000000 cellspacing=0 cellpadding=0 WIDTH="100%"> <tr> <% intLastLink = 1 If Len(Request.Querystring("Link")) then intLastLink = Request.Querystring("Link") end if For I = 0 to uBOUND(aLinks) If intLastLink-1 = I then%> <td align="center" bgcolor="#669999"><b><%=aLinks(I)%></b> </td> <%else%> <td align="center"> <a STYLE="text-decoration:none;color:#FFFFFF;" href="<%=aLinksHREF(I) &"?link=" &I+1%>" onmouseover="style.color='#FF0000'" onmouseout="style.color='#FFFFFF'"><%=aLinks(I)%></a> </td> <%end if Next%> <tr><td bgcolor="#669999" COLSPAN=<%=Ubound(aLinks)+1%>> </td></tr> </tr></table> <% End Sub%> <% '************************************************* *********************** 'aLinkNames(n) = User Defined array with text that will be displayed in the ' tabs 'aHREF(n) = HREF link to a corresponding page '************************************************* *********************** aLinkNames = array("Link1","Link2","Link3","Link4","Link5","Link6") aHREF = array("default.asp","page2.asp","page3.asp","page4.asp","page5.asp","page6.asp") DrawNavigation aLinkNames,aHREF %> Thanks. |
|
#2
|
|||
|
|||
|
Put a <tr> after the "If intLastLink ... " statement and a </tr> before the "end if" for that block.
Also, remove the <tr> that's right after your <table border=0 ... and the </tr> before the </table> |
|
#3
|
|||
|
|||
|
Actually, you should have a <tr> ... </tr> for each statement block of the if...then...else
For I = 0 to uBOUND(aLinks) If intLastLink-1 = I then%> <tr> <td align="center" bgcolor="#669999"><b><%=aLinks(I)%></b> </td> </tr> <%else%> <tr> <td align="center"> <a STYLE="text-decoration:none;color:#FFFFFF;" href="<%=aLinksHREF(I) &"?link=" &I+1%>" onmouseover="style.color='#FF0000'" onmouseout="style.color='#FFFFFF'"><%=aLinks(I)%></a> </td> </tr> <%end if Next%> |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > ASP menu help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|