時默認我在我的頁面中的8種圖片元素 -8影像變化,並返回左
<a href = "#"><img onmouseover="mousehover(this)" onmouseout="defaultImg(this)" src = "images/1_1.jpg" height="96" width="156" style="margin-right:12px;"/></a>
<a href = "#"><img onmouseover="mousehover(this)" onmouseout="defaultImg(this)" src = "images/2_1.jpg" height="96" width="156" style="margin-right:12px;"/></a>
懸停它應該改變從1_1到1_2至1_8,然後再次1_1。在鼠標移出時,它應該顯示默認圖片,即1_1。像這樣我有2_1,3_1到8_1。
爲mousehover的JavaScript函數就是 -
function mousehover(x){
for(var i=2; i<9; i++){
x.src = x.src.replace('images/rotator/1_' + i + '.jpg');
}
}
function defaultImg(x){
x.src = x.src.replace("images/rotator/1_1.jpg");
}
不知怎的,這款鼠標懸停FUNC不起作用。而我如何獲得鼠標所有圖像的defaultImg。我被困在這裏。有任何想法嗎?
丹你應該張貼小提琴 – Zword
當前是什麼行爲? – ltalhouarne
犯規切換和鼠標移出顯示無圖 – Dan