0
我試圖做一個mouseover/mouseleave圖像交換看到下面。它在我的本地工作很好,但是一旦在我的服務器上,mouseleave會給我一個圖像應該存在的斷開鏈接圖標。用開發人員工具查看它的代碼工作得很好,除了斷開的鏈接。我知道圖像路徑正在工作,因爲圖像在加載和懸停前存在。鼠標懸停和Mouseleave Jquery圖像交換。在本地工作 - 不在服務器上?
我很難過,任何意見將不勝感激!
<div class="testing123"><img src="images/BotGrid/images/blackFull_05_03.png" /></div>
$(document).ready(function(){
$('.testing123').on('mouseover', function(){
$(this).find('img').attr('src','images/BotGrid/images/yellowfull_05_03.png');
$(this).css({"backgroundColor": "black"});
});
$('.testing123').on('mouseleave', function(){
$(this).find('img').attr('src','images/BotGrid/images/blackfull_05_03.png');
$(this).css({"backgroundColor": "yellow"});
});
});
因此,黃色圖像顯示正確嗎?在鼠標懸停之前顯示黑白圖像? – Aarmora
是的,沒錯! – Wing