SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    assign a style for a link clicked

    I have a list of links on an asp-page. This list is generated dynamically. The links direct to the same page. When i click a link, the page reloads, but now i want the clicked link for navigaton issues to have a special color or whatever. Any ideas how this can be accomplished.

    Thanks for your patience

  2. #2
    SitePoint Guru moonman's Avatar
    Join Date
    Dec 2000
    Location
    The Sea of Tranquility
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put this in the CSS (obviously change the properties), then do the URL as normal.

    A.mylink:link {color: #000080; text-decoration: underline; font-weight: bold;font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 8pt}
    A.mylink:visited {color: #000080; text-decoration: underline; font-weight: bold;font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 8pt}
    A.mylink:hover {color: #DA251D; text-decoration: underline; font-weight: bold;font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 8pt}


    <a class="mylink" href="mypage.htm">Hello</a>

    The vistited property is the one you're after.
    Last edited by moonman; Jul 12, 2002 at 04:03.

  3. #3
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sorry, i didnt describe the problem properly

    I dont need the visited link-css, because when i use the visited-style, all my links in the list, will have the style, but i only want the last link clicked be highlighted.

    Imagine you have a list of three links, like mercedes, ford and toyota. Once i click toyota, the page reloads and toyota will be highlighted. Now i click ford and now ford should be highlighted and toyota should be normal.

  4. #4
    SitePoint Guru moonman's Avatar
    Join Date
    Dec 2000
    Location
    The Sea of Tranquility
    Posts
    696
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see. Sorry, I didn't understand.

    I can't help you then, sorry.

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) why reload the page - use remote scripting

    2) You know what was clicked - don't you?!
    SO when the page reloads just have something like

    <a href="bla" class="<% ($link_clicked eq $this_iteration_value)?'bloody_obvious':'just_normal' %> >

    etc

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •