Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Someone posted this before... Need help with it

    Hey, someone posted this before, its a script to make your links change when you click on them, with querystrings...

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    	"http://www.w3.org/TR/html4/strict.dtd">
    
    <html>
    
    <head>
    <title>PMO</title>
    <style>
    body {
    	margin: 0;
    }
    
    table.titleBar {
    	width: 100%;
    	text-align: center;
    	border-collapse: collapse;
    	border: 1px solid white;
    }
    td.titleBar {
    	color: white;
    	background-color: #00659C;
    	border: 1px solid white;
    	font-family: tahoma, verdana, helvetica;
    	font-weight: bold;
    	font-size: 8pt;
    }
    a.titleBar {
    	display: block;
    	text-decoration: none;
    	padding: 1px;
    }
    a:link.titleBar, a:visited.titleBar {
    	color: white;
    	background-color: #00659C;
    }
    a:hover.titleBar, a:active.titleBar {
    	color: #00659C;
    	background-color: white;	
    }
    .titlebar.selectedItem {
    	background-color: navy;
    }
    .titlebar.unselectedItem {
    	background-color: #00659C;
    }
    </style>
    </head>
    
    <body>
    
    <%
    ' List of menu items; The first element of the second level of the array has 
    ' the name of the menu item and the second element contains the links to 
    ' which the item points to.
    Dim asMenuItems, iItems, iItemWidth
    asMenuItems = array("Home", "Projects", "Links", "Admin", "Logout")
    iItems = UBound(asMenuItems) + 1	' Total number of elements in the array
    iItemWidth = CInt(100 / iItems)		' The width of each cell in the table row of the title-bar
    
    ' The menu-item selected by the user
    Dim sSelectedItem
    sSelectedItem = Trim(LCase(Request.QueryString("menuOption")))
    If Len(sSelectedItem) = 0 Then	' No option was selected; set a default option
    	sSelectedItem = Trim(LCase(asMenuItems(0)))
    End If
    %>
    <table class="titleBar" width="100%" cellpadding="1" cellspacing="0" border="0">
    <tr>
    <%
    For iCnt = 0 To UBound(asMenuItems)
    	If Trim(LCase(asMenuItems(iCnt))) = sSelectedItem Then
    %>
    	<td class="titleBar" align="center">
    		<a class="titleBar selectedItem"><% =asMenuItems(iCnt) %></a>
    	</td>
    <%
    	ElseIf LCase(asMenuItems(iCnt)) = "logout" Then	' The "logout" option should close the window
    %>
    	<td class="titleBar" align="center">
    		<a class="titleBar unselectedItem" href="java script:window.close();"><% =asMenuItems(iCnt) %></a>
    	</td>
    <%
    	Else
    %>
    	<td class="titleBar" align="center">
    		<a class="titleBar unselectedItem" href="menu.asp?menuOption=<% =asMenuItems(iCnt) %>"><% =asMenuItems(iCnt) %></a>
    	</td>
    <%
    	End If
    Next
    %>
    </tr>
    </table>
    
    </body>
    
    </html>
    How do you do this same thing, except with images?
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bugaha, NE
    Posts
    330
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try replacing:

    asMenuItems = array("Home", "Projects", "Links", "Admin", "Logout")


    with img tags:

    asMenuItems = array("<img src = "blah.jpg>", "("<img src = "bleh.jpg>", "("<img src = "blih.jpg>", "("<img src = "bloh.jpg>", "("<img src = "bluh.jpg>")


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •