图象跟随鼠标.htm

来自「VBSCRIPT的源码,相信很多html程序员都会用到,这些源码小小变动一下,可」· HTM 代码 · 共 44 行

HTM
44
字号
<html>
<head>
<META name=VI60_defaultClientScript content=VBScript>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>图像跟随鼠标</title>
<SCRIPT LANGUAGE=VBScript>
<!--
    Sub document_onmousemove
         set cur=document.all("it")
        cur.style.visibility="visible"
        height=cur.height
        width=cur.width
      if self.event.clientX>document.body.offsetWidth-5-width then
         newleft=self.event.clientX-5-width
       else
          newleft=self.event.clientX
      end if
      cur.style.left=newleft
       
      if self.event.clientY>document.body.offsetHeight-5-height then
          newtop=self.event.clientY-5-height
      else
          newtop=self.event.clientY
      end if 
      cur.style.top=newtop
 
   
End Sub
      
-->
</SCRIPT>
</head>
<body bgColor=peachpuff>
   <div  style="VISIBILITY: visible">
   <IMG id=it src="1.JPG" style="LEFT: 5px; POSITION: absolute; TOP: 5px; VISIBILITY: hidden; Z-INDEX: 10" width="135" height="146" >
 </div>
 <p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<FONT face=仿宋_GB2312 size=5>看看</FONT> 
   <font face="仿宋_GB2312" size="5">,效果是不是挺不错的!</font></p>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?