繁体   English   中英

PHP鼠标悬停不起作用?

[英]PHP mouse over not working?

我在我的 joomla 站点中尝试了以下脚本来检查文件是否存在以及它是否显示鼠标悬停图像..如果没有显示不同的鼠标悬停图像。 初始图像显示但图像无法在鼠标悬停或鼠标关闭时加载。 我在这个例子中使用了相同的图像..

    <?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.'\';"/>';
?>

任何想法我的鼠标悬停在代码上有什么问题?

我忘了在整个代码中添加路径:

echo '<img src="/administrator/components/com_srshare/images2/'.$image_on.'" onmouseover="this.src=\''.$image_off.'\';" onmouseout="this.src=\''.$image_on.'\';"/>';

本来应该:

echo '<img src="/administrator/components/com_srshare/images2/'.$image_on.'" onmouseover="this.src=\'/administrator/components/com_srshare/images2/'.$image_off.'\';" onmouseout="this.src=\'/administrator/components/com_srshare/images2/'.$image_on.'\';"/>';

有时候,显而易见的东西是看不见的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM