加入收藏
-
网站地图
-
网站搜索
-
网奇首页
公司简介
网奇动态
招贤纳士
加盟代理
商城系统
分类系统
点卡系统
系统开发
网站管家
访客留言
首页
→
站长世界
→
特效代码
阅读新闻
跟随鼠标弹性效果的运动图片
[日期:
02-03
]
来源:
作者:
[字体:
大
中
小
]
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>网页特效观止|www.jscode.cn| --- 跟随鼠标弹性效果的运动图片</title> </head> <body bgcolor="#000000"> <STYLE> v\:* { BEHAVIOR: url(#default#VML) } </STYLE> <SCRIPT language="JavaScript1.2"> var stringcolor="white" var ballsrc="http://www.jscode.cn/JsCode/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>
提示:您可以先修改部分代码再运行
1、在IE、FF中测试,只在IE出现文字溢出现象。
说明:注释造成文字溢出是IE的BUG。
【
评论
】 【
推荐
】 【
打印
】
上一篇:
用鼠标移动显示的图片类似google地图
下一篇:
相关新闻
关于网奇
汇款方式
招纳贤士
加入收藏
网站地图
网站搜索
简
繁
默
电话:03357668688 传真:03357668688-15 售前QQ:228918804 MSN:Qiwang
188.com Email:Qiwang
188.com
Copyright © 秦皇岛网奇网络科技有限公司
冀ICP备05008592号