我有5个不同的图像被用作锚。我希望有一个图像替换悬停和保持整个点击行动的图像。然后保留该新图像,直到点击了具有相同类的另一个图像。我不确定如何实现这个功能。该守则如下。谢谢你们提前。悬停和onClick图像交换
HTML
<img class="year" id="yr60" src="/images/1960-a.jpg" style="height:24px;margin-left:132px;position:relative;top:-150px;width:96px;" />
<img class="year" id="yr70" src="/images/1970-a.jpg" style="height:24px;margin-left:55px;position:relative;top:-150px;width:96px;" />
<img class="year" id="yr80" src="/images/1980-a.jpg" style="height:24px;margin-left:55px;position:relative;top:-150px;width:96px;" />
<img class="year" id="yr90" src="/images/1990-a.jpg" style="height:24px;margin-left:55px;position:relative;top:-150px;width:96px;" />
<img class="year" id="yr20" src="/images/2000-a.jpg" style="height:24px;margin-left:55px;position:relative;top:-150px;width:96px;" />
每个悬停图像是SRC = “/图片/ 1960-h.jpg” | src =“/ images/1970-h.jpg”| SRC = “/图片/ 1980-h.jpg” 等
[whathaveyoutried.com](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Dharman