SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Vancouver, Canada
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question javascript rollover using text instead of images

    Hi everyone,

    Now this is a question most will find weird but I hope you can still help me.

    If you go to http://www.shootingstar.ca , and look at the top navigation you'll find that all my links are text link. I create the roll over effect by using CSS.

    But on the home page, I want to turn these links into javascript links so the Search engines can't follow these links--especially Google. Is there a way to keep the text links and create the exact same effect as you see it now, but turn the <a href...> into a javascript link?

    the existing links says:
    <a href="index.html" class="indexnavigation">home</a>

    I have an existing external css file which says...

    a.indexnavigation:link {
    font-size: 7;
    text-decoration: none;
    font-weight:bold;
    color: #ffcc33;
    cursor: pointer;
    cursor:hand;
    }

    a.indexnavigation:visited {
    font-size: 7;
    text-decoration: none;
    font-weight:bold;
    color: #ffcc33;
    cursor: pointer;
    cursor:hand;
    }

    a.indexnavigation:hover {
    font-size: 7;
    text-decoration: none;
    font-weight:bold;
    color: #3399cc;
    cursor: pointer;
    cursor:hand;
    }

    a.indexnavigation:active {
    font-size: 7;
    text-decoration: none;
    font-weight:bold;
    color: #ffcc33;
    cursor: pointer;
    cursor:hand;
    }

    Note: I've added "cursor: pointer; cursor:hand;" as I was experimenting with creating a javascript link and still keep the same effects.

    I really hope someone can help me with it.

    sheriff

  2. #2
    SitePoint Zealot simplyunique's Avatar
    Join Date
    Jun 2003
    Location
    Montreal
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why dont you want those pages indexed?

    If you dont want them indexed just put the appropraite robots noindex tag in the head of each doc.
    Fonkuscious say: Sink a foot in into my code and stub your toe

  3. #3
    Rabble Rouser bronze trophy
    Join Date
    Jan 2003
    Location
    Mountain View, CA
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or use a robots.txt file
    or a .htaccess file rejecting them based on user agent

    or did you want to keep people who turn off/don't have javascript out of there as well?

  4. #4
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a id="link">link</a>
    <script>
    document.getElementById("link").href="page.html"
    </script>
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  5. #5
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Vancouver, Canada
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,
    I want these pages to be indexed, I just don't want Google to follow these links.

    I will have one html link to a site mape page and that will be the only link google will be able to follow from the home page to the internal pages. But the internal pages will all link to the home page using regular html links

    This way Google can treat my home page as an authoritive page, the internal pages give some of their Google pagerank to the home page and the home page is prevented from giving some of it's pagerank to the internal pages. The home page is targeting the most competitive key phrases so I want it to give it as much boost in page rank as I can.

    Markdidj, I don't totally understand these codes. I am not as comfortable with javascript as I am with SEs.

    So the codes are

    <a id="link">link</a>

    <script> document.getElementById("link" ).href="page.html" </script>

    So I should have a css codes with the id name:

    #link {
    put something here;
    }

    Is there something specific I should add there?

    Then the part that is in <script> document.getElement...</scrit>, that looks like javascript. is that code meant to make the browser apply what's in the css?

    Thanks again

    Sheriff
    Last edited by SheriffG.Guirguis; Jul 6, 2003 at 00:35.

  6. #6
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Dont apply css to a link like that, use a class instead ie
    Code:
    <style>
    a.links { color:red }
    a.links:hover {color:brown }
    a.links:active { background:brown }
    </style>
     
    <a id="link1" class="links"></a>
    <a id="link2" class="links"></a>
    <script>
    document.getElementById("link1").href="link1.html"
    document.getElementById("link2").href="link2.html"
    </script>
    you don't HAVE to put css to an id, it's also there to name the object.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  7. #7
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Vancouver, Canada
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks again Markdidj


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •