...

View Full Version : Someone posted this before... Need help with it



The Wizzard
01-14-2003, 07:01 AM
Hey, someone posted this before, its a script to make your links change when you click on them, with querystrings...



<!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?

BigDaddy
01-14-2003, 08:31 PM
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>")



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum