我有两个数组,其中包含这样的图像名称列表
array 1 = ["arrow1.png", "arrow2.png", "arrow3.png", "arrow4.png", "arrow5.png"]
array 2 = ["arrow_over1.png", "arrow_over2.png", "arrow_over3.png", "arrow_over4.png", "arrow_over5.png"]
我想用id="alter_img"
鼠标悬停和mouseleave更改div标签中的图像在mouseover上应该是"arrow1.png"
,在mouseleave上应该是arrow_over1.png
结构是这样的
<div id="alter_img">
<img src="arrow1.png">
<img src="arrow2.png">
<img src="arrow3.png">
<img src="arrow4.png">
<img src="arrow5.png">
</div>
我怎么能那样做?