-2
我已經在我的joomla網站上試過以下腳本來檢查一個文件是否存在,以及它是否顯示一個鼠標懸停圖像..如果不是在圖像上顯示不同的鼠標。初始圖像顯示,但圖像無法加載鼠標或鼠標關閉。我在這個例子中使用了相同的圖像..PHP鼠標不能正常工作?
<?php
$image_on = 'sr_act_i_2.png';
$image_off = 'sr_act_i_1.png';
$actionsloaded = 'location of file I will be checking';
if(file_exists($actionsloaded))
echo '<img src="/administrator/components/com_srshare/images2/'.$image_on.'" onmouseover="this.src=\''.$image_off.'\';" onmouseout="this.src=\''.$image_on.'\';"/>';
else
echo '<img src="/administrator/components/com_srshare/images2/'.$image_on.'" onmouseover="this.src=\''.$image_off.'\';" onmouseout="this.src=\''.$image_on.'\';"/>';
?>
任何想法我的鼠標在代碼上出了什麼問題?
檢查懸停路徑 –
您的鼠標懸停代碼沒有問題......您的文件路徑錯誤。請稍等......再看一遍......你會得到它 – Ragdata
謝謝。我忘了通過代碼添加路徑 –