Simon Wigzell a écrit :
It is a simple question of CSS,
no need of JS for that.
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
'empty.gif' is a transparent image of 1 px
--
sm
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?
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?
no need of JS for that.
Code:
<style type="text/css">
a img { width: 98px; height: 32px; border: none; }
a { background: url(img1/jpg) no-repeat center center; }
a.visited { background-image: url(img2.jpg); }
a.hover { background-image: url(img3.jpg); }
a.active { background-image: url(img4.jpg); }
</style>
(where the 3 main images are sticked side by side)
if not, user will have to wait the new image of the roll-over
Code:
a { background: url(button/jpg) no-repeat center center; }
a.visited { background-position: left center); }
a.hover { background-position: right center; }
a.active { background-image: none; background: red;}
Code:
<a href="#"> <img src="empty.gif" alt="menu 1"> </a>
'empty.gif' is a transparent image of 1 px
--
sm
Comment