Sticky Rollovers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rothrock

    Sticky Rollovers

    I trying to build a navigation bar for my company's website.

    We have different sections, Home, About, Product, etc.

    I have made the graphics and the basic JS for the Rollovers.

    To indicate which section a user is in, I would like to have all the pages
    in the Home section show the Home graphic as a reversed version, and so on
    for the other sections.

    I already have the reversed version of the graphic and I could go and
    change the code for each section, but I would like to have somekind of
    code that I just plunked down on each page.

    Can anybody give me pointers? A link to a tutorial? etc?

  • Mick White

    #2
    Re: Sticky Rollovers

    Rothrock wrote:
    [color=blue]
    > To indicate which section a user is in, I would like to have all the pages
    > in the Home section show the Home graphic as a reversed version, and so on
    > for the other sections.
    >
    > I already have the reversed version of the graphic and I could go and
    > change the code for each section, but I would like to have somekind of
    > code that I just plunked down on each page.
    >
    > Can anybody give me pointers? A link to a tutorial? etc?
    >[/color]

    You could adopt a naming scheme for your document title, e.g.:

    <title="Conta ct our representatives ">

    Then if you key on first word, be sure name your image accordingly:
    <img src="contact.gi f" name="contact">
    And then change the source:

    <script>
    k= document.title. split(" ")[0].toLowerCase()// contact

    document.images[k].src=k+"Reverse d.gif"
    //document.images["contact"].src="contactRe versed.gif"
    </script>


    Mick

    Comment

    • Rothrock

      #3
      Re: Sticky Rollovers

      Clever! I hadn't thought of using the title like that. I'm going to give it
      a try. Thank you.

      Comment

      Working...