⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 跟随鼠标弹性效果的运动图片.txt

📁 网页特效的代码,在美化网页时有很大的作用
💻 TXT
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>跟随鼠标弹性效果的运动图片</title>

</head>

<body>

<STYLE>
v\:* {
 BEHAVIOR: url(#default#VML)
}
</STYLE>
 <SCRIPT language="JavaScript1.2">
var stringcolor="#00cc00"
var ballsrc="../../../images/flag.gif" //改为自己的图片路径及名称 
if (document.all&&window.print){
document.write('<IMG id=Om style="LEFT: -10px; POSITION: absolute" src="'+ballsrc+'">')
ddx=0;ddy=0;PX=0;PY=0;xm=0;ym=0
OmW=Om.width/2;OmH=Om.height/2
}
function Ouille(){
 x=Math.round(PX+=(ddx+=((xm-PX-ddx)*3)/100))
 y=Math.round(PY+=(ddy+=((ym-PY-ddy)*3-300)/100))
 Om.style.left=x-OmW
 Om.style.top=y-OmH
 elastoc.to=x+","+y
elastoc.strokecolor=stringcolor
 setTimeout("Ouille()",1)   
}
function momouse(){
 xm=window.event.x+5
 ym=window.event.y+document.body.scrollTop+15
 elastoc.from=xm+","+ym
}
if(document.all&&window.print){
code="<v:line id=elastoc style='LEFT:0;POSITION:absolute;TOP:0' strokeweight='1.5pt'></v:line>"} else {
code="<v:group style='LEFT:-10;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' coordsize='21600,21600'><v:line id=elastoc style='LEFT:0;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' strokeweight='1.5pt'></v:line></v:group>"}
if(document.all&&window.print){
document.body.insertAdjacentHTML("afterBegin",code)
document.onmousemove=momouse
Ouille()
}
</SCRIPT>

</body>

</html>

⌨️ 快捷键说明

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