using a:hover to change the color of an image

后端 未结 3 1265
孤独总比滥情好
孤独总比滥情好 2021-01-22 07:39

In the following example, a mouse hover over each link changes the image:

http://www.prism.gatech.edu/~dm257/sprite.html

The trick is the following line of code:

相关标签:
3条回答
  • 2021-01-22 08:04

    Styling of :visited is currently limited to prevent security risk related to exposing user's browsing history:

    https://developer.mozilla.org/En/CSS/%3Avisited:

    Starting in Firefox 4, major limitations to the styles you can apply using this selector have been introduced. For more information on the limitations and the motivation for them, see Privacy and the :visited selector. The same limitations have been adopted by other browsers, including Safari 5/4.1 and Chrome 6.

    0 讨论(0)
  • 2021-01-22 08:21

    you can accomplish with the help of this plugin - Visited links plugin

    Download JS: jQuery.visited.js

    See below lins which is related:

    • set a:visited style with javascript or jquery
    • Setting CSS pseudo-class rules from JavaScript
    0 讨论(0)
  • 2021-01-22 08:24

    You absolutely can. Of course, the :visited state will only be visible upon the next load of the page. Browsers are able to determine whether or not a page has been previously accessed via header information.

    Here's a jsFiddle that demonstrates the proper declaration order with helpful comments:

    • http://jsfiddle.net/fmYdD/4/
    0 讨论(0)
提交回复
热议问题