www.webdeveloper.com
Results 1 to 11 of 11

Thread: Link color after next visit of page

  1. #1
    Join Date
    Nov 2002
    Posts
    4

    Question Link color after next visit of page

    I created web page with link. If I clicked on link then color of link was changed to color of visited link. This is expected behaviour. Then I closed web page and I opened it again. Color of previously visited link was color of visited link. I expected that color of link will be color of unvisited link but link had color of visited link.
    What shall I do if I want to have link coloured by color of unvisited link after every next open of web page although link was coloured by visited link colour after click on it during previous session on web page?

    Thanks for help in advance.

  2. #2
    Join Date
    Nov 2002
    Posts
    411
    that sounds like a real toughy - it's showing up as a visited link because of just that: it's been visited. As far as I'm aware, the browser checks the history to see which links have been followed and which haven't: closing the browser window will not remove the link from the history list, which is why it shows up again as visited.

    The only suggestions that I can come up with are to use style sheets to set the colours for the links and visited links. (eg put A:link {color:red} ; A:active {color:red} and A:visited {color:red}. This will only make all the links the same colour, but I suspect that the effect that you want to achieve will require a considerable amount of programming for what it will do in the end. From the little that I know you may be able to do it with javascripts, but think that you might have to do it with ASP's (or Perl or something along those lines) which can then dynamically colour the links that the user follows in that visit to the site only. But then of course you'll need to have a host that lets you run dynamic pages and set up the code to flag which pages have been visited and which havent etc.

    I look forward to hearing other people's comments - sorry if I wasn't too helpful.
    John

  3. #3
    Join Date
    Nov 2002
    Posts
    4

    Smile Thanks for opinion

    Thank you very much that you found time to sit over it. I am looking forward for next opinions, suggestions.

  4. #4
    Join Date
    Nov 2002
    Location
    Hawaii
    Posts
    6
    Just use some html to make them all the same color. Use blue for example:
    <body link="blue" alink="blue" vlink="blue>

    Thats all you need.

  5. #5
    Join Date
    Nov 2002
    Posts
    631
    Originally posted by tomroten_10
    Just use some html to make them all the same color. Use blue for example:
    <body link="blue" alink="blue" vlink="blue>

    Thats all you need.
    link = a link before it is clicked.
    alink = an active link
    vlink = a visited link

  6. #6
    Join Date
    Nov 2002
    Location
    Hove, UK
    Posts
    160
    This could be down to the 'Hitory' settings in your browser - if it is set to '0' everything will show as un-visited.

  7. #7
    Join Date
    Nov 2002
    Posts
    4

    Different colors

    Thanks for ideas, BUT

    I want to have during one session distinguished links by visited and unvisitied colors and then after next open of web page everything should look like unvisited.
    Seeting with History=0 does not work for me.

  8. #8
    Join Date
    Nov 2002
    Location
    Hove, UK
    Posts
    160
    OK, then what you want can't be done with simple HTML.

    HTML is static and can't remember anything for you - you could write some PHP to do this though.

  9. #9
    Join Date
    Nov 2002
    Posts
    4

    Thumbs up Thanks for advice

    I think so as well. Thanks for advice.

  10. #10
    Join Date
    Dec 2002
    Posts
    19
    UH!!!!!!!!!!!!!

    Try changing the setting to override the style sheet of the HTML

    By setting the visited, link, active and hover links in your browser

    IE ONLY

    Click TOOLS, selcted INTERNET OPTIONS
    Under the GENERAL tab, select COLORS button

    and change the colors to reflect your color scheme.
    wouldn't that override the color scheme of the link on hte html page.

    Not Sure!
    Tables work, but eatin becomes messy!

  11. #11
    Join Date
    Nov 2002
    Posts
    411
    well yes it would but if you read the posts you'll notice that that isnt what he's asking for at all - those have already been suggested by any number of people as alternatives, but he wants the links to become different colours when active / visited for that persons visit to the page only. When the person returns he wants the links to go back to their original colours, and only change when they're visited for that session.
    John

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles