[thelist] javascipt and css hover

rudy r937 at interlog.com
Mon May 13 17:12:01 CDT 2002

> yep. really the complication is that I'm attempting to use
> the same navigation on all of these pages being called
> from the include.

hi adam

well, there's your answer

you can do it using server side include logic

josh's example was --

> You have two pages, one.html and two.html.  Each of these
> pages has two links, href=one.html and href=two.html.  Now what?

the way i would look at it is like this -- one.html would not have a link
to itself, rather, that link would be "greyed out" (which also indicates
that it is the page you are on)

two.html would have a link to one.html but the link to two.html would be
greyed out -- again, indicating that this is the page that you're on

if you go from one.html to two.html, the link on two.html pointing to
one.html could be set to have a visited style (purple, not blue, if you go
with convention), but it is also quite common for nav bars not to use
visited styles on links

so on the server side, you test to see which page you're on, and generate
plain text instead of a link for the link that matches the page you're on

here's some sample XSSI (extended server-side include) code --

create a file called navbar.shtml with the following --

   <!--#if expr="$DOCUMENT_NAME = /home/" -->Home
      <!--#else --><a href="home.html">Home</a><!--#endif -->
   <!--#if expr="$DOCUMENT_NAME = /products/" -->Products
      <!--#else --><a href="products.html">Products</a><!--#endif -->
   <!--#if expr="$DOCUMENT_NAME = /faq/" -->FAQ
      <!--#else --><a href="faq.html">FAQ</a><!--#endif -->
   <!--#if expr="$DOCUMENT_NAME = /contact/" -->Contact
      <!--#else --><a href="contact.html">Contact</a><!--#endif -->

then on every page, just

   <!--#include file="navbar.shtml" -->

the neat part about this solution is that you don't have to do anything on
the client side with javascript (which you shouldn't rely on for nav
purposes anyway)

make sense?  if not, holler


More information about the thelist mailing list