|
Posted by Adrienne Boswell on 02/13/07 15:25
Gazing into my crystal ball I observed "Tom" <tgaughan@numail.org>
writing in news:1171376476.945926.174750@a75g2000cwd.googlegroups.com:
>> > When the menu code was in each html file I would change the color
of
>> > the menu header that was current...i.e., if they click a sub topic
>> > under the About menu I would change the color of About from blue to
>> > "white"...Now that my menu code is included how can I affect
attribute
>> > changes...can it be done by using the ID...our menus are table
>> > combined with CSS
>>
>> > Each menu topic is in a <td> tag with an ID.
>>
>> It's late, it's late, it's half past eight... I'd say to tag the
>> click and colour the code, menu the header and ID the node...
>>
>> --
>> dorayme
>
> I was remiss that when I said that I "moved them over" - I did not
> specifically add "to the server"...Now perhaps you would reciprocate
> and specify exactly what you mean...code sample would help greatly...
>
>
I'm being generous today... this is what I do and it works very well.
On the top of every page:
<% option explicit
thispage = "page title"
thisurl = "example.asp"
%>
....
<title><%=thispage%></title>
</head>
<body>
<h1><%=thispage%></title>
....
</body>
In nav_inc.asp:
<% pagelist = "Home, About, Contact"
urllist = "index.asp, about.asp, contact.asp"
pagearr = split(pagelist,", ")
urlarr = split(urllist,", ")
%>
<ul>
<%
for i = 0 to ubound(pagearr)
<%=navlist(pagearr(i),urlarr(i))%>
next
%>
</ul>
<%
function navlist(page,link)
if thispage = link then
navlist = "<li><a href=" & chr(034) & link & chr(034) & " class="
& chr(034) & "currentpage" & chr(034) & ">" & page & "</a></li>"
else
navlist = "<li><a href=" & chr(034) & link & chr(034) ">" & page &
</a></li>"
end if
end function
%>
The reason you want to use class here instead of id is because you may
have to use the same menu elsewhere on the page, and an id can only be
used once.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Navigation:
[Reply to this message]
|