473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Re: How do links know they have been visited?

SAM
Simon Wigzell a écrit :
I wish to duplicate text link behaviour with some button images. Hover is
easy but other than saving cookies how can I know if the page that the
button liks to has been visited so that I can display a different image?
It is a simple question of CSS,
no need of JS for that.

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. a img { width: 98px; height: 32px; border: none; }
  3. a { background: url(img1/jpg) no-repeat center center; }
  4. a.visited { background-image: url(img2.jpg); }
  5. a.hover { background-image: url(img3.jpg); }
  6. a.active { background-image: url(img4.jpg); }
  7. </style>
Better working with an alone image
(where the 3 main images are sticked side by side)
if not, user will have to wait the new image of the roll-over

Expand|Select|Wrap|Line Numbers
  1. a { background: url(button/jpg) no-repeat center center; }
  2. a.visited { background-position: left center); }
  3. a.hover { background-position: right center; }
  4. a.active { background-image: none; background: red;}
Expand|Select|Wrap|Line Numbers
  1. <a href="#">
  2. <img src="empty.gif" alt="menu 1">
  3. </a>

'empty.gif' is a transparent image of 1 px

--
sm
Jun 27 '08 #1
1 1334
Thanks, that is a much simpler solution than what I was attempting..


"SAM" <st*********************@wanadoo.fr.invalidwrote in message
news:48*********************@news.orange.fr...
Simon Wigzell a écrit :
>I wish to duplicate text link behaviour with some button images. Hover is
easy but other than saving cookies how can I know if the page that the
button liks to has been visited so that I can display a different image?

It is a simple question of CSS,
no need of JS for that.

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. a img { width: 98px; height: 32px; border: none; }
  3. a { background: url(img1/jpg) no-repeat center center; }
  4. a.visited { background-image: url(img2.jpg); }
  5. a.hover { background-image: url(img3.jpg); }
  6. a.active { background-image: url(img4.jpg); }
  7. </style>

Better working with an alone image
(where the 3 main images are sticked side by side)
if not, user will have to wait the new image of the roll-over

Expand|Select|Wrap|Line Numbers
  1. a { background: url(button/jpg) no-repeat center center; }
  2. a.visited { background-position: left center); }
  3. a.hover { background-position: right center; }
  4. a.active { background-image: none; background: red;}

Expand|Select|Wrap|Line Numbers
  1. <a href="#">
  2.   <img src="empty.gif" alt="menu 1">
  3. </a>


'empty.gif' is a transparent image of 1 px

--
sm
Jun 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand...
7
by: Will Hartung | last post by:
I have this: <a class="pink_link" href="faq.html#q1">Go to question 1</a> And the CSS is simply: ..pink_link {color: #fa61b7; font-weight: bold;} So, I'm curious why my links are blue and...
6
by: Pasi Kovanen | last post by:
How do I define for example link inside H1 style to be of different color than other links in the same page: <a href="blah">this is some color</a> <h1><a href="blahblah">this is different...
3
by: Elmo Watson | last post by:
For our intranet - I've standardized on black for links (from input of users) - no change for visited, etc... However, on one page, I've been asked to make the normal blue for non-visited/purple...
19
by: opt_inf_env | last post by:
Hello all, I know that in html to set colors of visited and activ links one need to use line in the following format: <BODY text="#FF0000" link="#0000FF" alink="#FFFF00" vlink="#00FF00"> ...
3
by: Jim Corey | last post by:
I have a datagrid displaying a report, which includes link buttons that I use to drill down. A. When I return to the datagrid the links display as visited. B. If I run my report again and...
0
by: PsyBorg | last post by:
This is not entirely a PHP question although it is based in PHP. I have been creating a site, where I want the visitors to see the visited links as "Crossed Out" using CSS. However, I also want...
5
by: senaka | last post by:
Hi, I need to identify the visited links on a clients machine dynamically. When he/she loads my page i need to know what links were visited during the previous session(s). This is not regarding...
2
by: jkizmannRU09 | last post by:
I know how to adjust the look of visited links with a CSS stylesheet, but how would one create individual variations among a set of links? For example, say I have three links, all initially...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.