JavaScript小记一则:今天在写VS2005——.NET程序时,写的一个JS图片示例案例
源码如下,如遇调试问题,可以找我解决:
<!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>
示例图如下,当鼠标移动时显示:
当鼠标移开时,自动隐藏图片:


分类:
JavaScript
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了