源码如下,如遇调试问题,可以找我解决:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>JS查看示例图(鼠标移动显示,移开隐藏)</title>
    <script type="text/javascript">
        function over(){ 
            img = document.getElementById("Example"); 

            img.style.display = "block"; 
        } 
        function out(){ 
            img = document.getElementById("Example"); 
            img.style.display = "none"; 
        } 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="right" align="left">
         <table style="TABLE-LAYOUT: fixed; WIDTH: 593pt; BORDER-COLLAPSE: collapse" cellSpacing="0"
                    cellPadding="0" width="860" border="1">
            <tr>
                <td colSpan="4" id="ExamplePhoto" align="center">
                <p onmouseover="over()" onmouseout = "out()"><span style="font-weight:bold;color:Red;text-decoration:underline;">点我查看示例</span></p> 
                <img src="../Img/LoginPhoto.jpg" id="Example" width="750" height="250"/> 
                </td>
            </tr>
          </table>
    </div>
    </form>
</body>
</html>
示例图如下,当鼠标移动时显示: 当鼠标移开时,自动隐藏图片: 今天在写VS2005——.NET程序时,写的一个JS图片示例案例 随笔 第1张 今天在写VS2005——.NET程序时,写的一个JS图片示例案例 随笔 第2张
  

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。