Closed Thread Icon

Preserved Topic: Changing active menu item (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18219" title="Pages that link to Preserved Topic: Changing active menu item (Page 1 of 1)" rel="nofollow" >Preserved Topic: Changing active menu item <span class="small">(Page 1 of 1)</span>\

 
wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 08-02-2001 18:35

Hello all,

I was wondering if someone might be able to tell me how I can get the active menu item to change its appearance. I have my menu (as an include) in a black and white table, and would like to basically reverse the colors for whatever the active page is. At the edge of my brain I can kind of see how to do it , but ........

anyways, I tried a search and couldn't find anything, but maybe I was using the wrong terms. Any and all help is appreciated. I am slowly learning JS, but it is becoming readily apparent that I ride the short bus to javascript school.

thanks

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-02-2001 19:12

What menu are you talking about?

wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 08-02-2001 19:41

At the top of each page (which are drilldown frames), I put this "internal" include menu that by choosing a menu item, brings up the life history or meristic or whichever data for the fish species selected. I am using cold fusion (hence the cf tags). here is what my menu and style tags look like right now.

a:link {font: bold 11pt helvetica, arial, "sans serif"; color:#6699ff; text-decoration:none; text- align:center;}
a:visited {font: bold 11pt helvetica, arial, "sans serif"; color:#6666cc; text-decoration:none; text-align:center;}
a:hover {font: bold 11pt helvetica, arial, "sans serif"; color:#33ccff; text-decoration:none; text-align:center;}
div.gshead {font: bold 13pt arial; color:#ffffff; text-align:center;}

<div align="center">
<table width=450 border=0 cellspacing=0 cellpadding=0>
<tr>
<td bgcolor="black">
<table width="450" border=0 cellspacing=3 cellpadding=5 align="center">
<tr>
<cfoutput query="qryGS">
<td colspan=3>
<div class=gshead>#qryGS.GSID#</div>
</td>
</cfoutput>
</tr>
<tr>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataIll.cfm?GSID=#qryGS.GSID#" target="SpecLH">Illustration</a>
</td>
</cfoutput>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataMer.cfm?GSID=#qryGS.GSID#" target="SpecLH">Meristics</a>
</td>
</cfoutput>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataLH.cfm?GSID=#qryGS.GSID#" target="SpecLH">Life History</a>
</td>
</cfoutput>
</tr>
<tr>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataELH.cfm?GSID=#qryGS.GSID#" target="SpecLH">ELH Description</a>
</td>
</cfoutput>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataDist.cfm?GSID=#qryGS.GSID#" target="SpecLH">Distribution</a>
</td>
</cfoutput>
<cfoutput query="qryGS">
<td bgcolor="white" align="center">
<A HREF="LHDataLit.cfm?GSID=#qryGS.GSID#" target="SpecLH">Literature</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>

So if I have chosen to view the Illustrations, and am on that page, I would like to be able dynamically change the appearance of the Illustration menu option.

Does this answer what you asked?



[This message has been edited by wcr one (edited 08-02-2001).]

Dark
Neurotic (0) Inmate
Newly admitted
posted posted 08-02-2001 20:27

might help if we could see the site for reference.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-02-2001 20:40

I don't use ColdFusion, so I can't help you with that, but here's how I would do that in PHP:

<?php if ($currentPage == "whatever") { ?>

<td bgcolor="black" align="center">
<B>Illustration</B>
</td>

<?php } else { ?>

<td bgcolor="white" align="center">
<A HREF="LHDataIll.cfm?GSID=#qryGS.GSID#" target="SpecLH">Illustration</a>
</td>

<?php } ?>

wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 08-02-2001 22:13

Thanks mr. max, I will try to work that around for cold fusion. I had that in mind, but was kind of looking for a way to do it with one smaller piece of script that would dymanically use the document name (document.formname...) and then change the background and text colors of the related link <td>. It seemed like there would a more "code efficient" method. Hope that does not sound like I am grateful for your help though, because I am.

mr. dark, the site exists on my pc right now so there is lookie 4 u.



[This message has been edited by wcr one (edited 08-02-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 08-02-2001 22:35

Well, having a JavaScript that will change links wouldn't be the most code efficient method, because JS is executed at the client side after the page is served to the browser. It is best to do the change on server side before serving the page. Anyway, if you're looking for the most code efficient method, then simply create an array of all links and use for loop to print them out (of course, in every iteration you should put if statement that will check if it is current page and output it accordingly).



[This message has been edited by mr.maX (edited 08-02-2001).]

wcr one
Paranoid (IV) Inmate

From: seattle
Insane since: Mar 2001

posted posted 08-02-2001 22:40

Well that makes sense. thanks a bunch.

« BackwardsOnwards »

Show Forum Drop Down Menu