• 文字广告位
  • 文字广告位
  • 文字广告位
您现在的位置: 站长手册 >> 特效代码 >> 鼠标类 >> 正文
站内搜索
Google
[组图]摇晃光标踪迹
          ★★★   

摇晃光标踪迹

雅虎收藏夹 百度收藏 Google书签 Yahoo书签 新浪ViVi 搜狐网摘 365Key网摘 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks
人气: 来源:本站原创 作者:佚名 所属栏目:鼠标类 [切换到繁體中文]
介绍:这是给人深刻印象的用DHTML产生的摇晃光标效果。 容易安装并且跨浏览器,你和你的访客都将会爱它!

演示:

[Ctrl+A全选 提示:你可先修改部分代码,再按运行]

下面教你如何应用此特效:图片
 --------------------------------------------------------------------------------------
  需要在<body 这里>加入的代码:onLoad="startthedots()"
 --------------------------------------------------------------------------------------
以下代码加到<head>…</head>中
以下代码加到<body>…</body>中
<SCRIPT language=JavaScript>
window.onerror=null;
netscape = (document.layers) ? 1:0;
goodIE = (document.all) ? 1:0;
document.onmousemove=MoveHandler;
var gotthere = 0;
var count = 0;
var ietopcorner=''
var ieleftcorner=''
    toplocation = new Array( 0,30,57,80,101,125,80,80,101,125,80,0 );
temptoplocation = new Array( 50,100,100,150,150,200,200,100,150,150,200,200,0 );
    leftlocation = new Array( 0,292,318,181,181,217,263,318,181,181,217,263,-96 );
templeftlocation = new Array( 0,0,260,390,420,550,680,390,420,550,680,0 );
difftop = new Array( 0,0,0,0,0,0,0,0,0,0,0,0 );
diffleft = new Array( 0,0,0,0,0,0,0,0,0,0,0,0 );
questtop = -13;
questleft2 = -96;
if (netscape) {
   document.body=new Object()
   document.body.scrollTop=''
   document.body.scrollLeft=''
   window.captureEvents(Event.MOUSEMOVE);
   window.onMouseMove = MoveHandler; 
   var layerstart = "document.";
   var layerleft = ".left";
   var layertop = ".top";
   var layerstyle = "";
   var windowWidth = window.innerWidth;
   var windowHeight = window.innerHeight;  }
else if (goodIE) {
   ietopcorner=document.body.scrollTop
   ieleftcorner=document.body.scrollLeft
   layerstart = "document.all.";
   layerleft = ".left";
   layertop = ".top";
   layerstyle = ".style";
   windowWidth=600;
   windowHeight=400; }
// end error trapping
   var Ypos2 = 72;
   var Xpos2 = 72;
function MoveHandler(e) {
if (netscape || goodIE) {
  Xpos2 = (netscape)?e.pageX:event.x
  Ypos2 = (netscape)?e.pageY:event.y
Xorigin = Xpos2;
Yorigin = Ypos2; 
if (Ypos2 > windowHeight/2) {
if (Xpos2 > windowWidth/2) { direction = 1;} 
else { direction = -1;} }
else {
if (Xpos2 > windowWidth/2) { direction = -1;} 
else { direction = 1;} }
}}
function startthedots() {
if (goodIE) {
windowWidth=document.body.clientWidth;
windowHeight=document.body.clientHeight; }
Xorigin = 204;
Yorigin = 147; 
spin();run(); }
var OrbitSize = 200;
count=1; delay=100; direction = -1;
Count = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
Xpoint = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
Ypoint = new Array ( 0, .63, 1.26, 1.89, 2.52, 3.15, 3.78, 4.41, 5.04, 5.67 );
var speed = -0.06;
var offset = 1;
  function spin() {
for ( j = 0 ; j <= 9 ; j++ ) {
Count[j] = Count[j] + (speed*direction); 
 Xpoint[j] = Xorigin + ((OrbitSize*Math.sin(Count[j])*offset)); 
 Ypoint[j] = Yorigin + (OrbitSize*Math.cos(Count[j])); }
setTimeout('spin()',3); }
function run() {
   count++; 
  for ( j = 0 ; j <= 9 ; j++ ) {
difftop[j]  = Ypoint[j] -  temptoplocation[j];
diffleft[j] = Xpoint[j] - templeftlocation[j];
diff = 30;
temptoplocation[j] = temptoplocation[j] + difftop[j]/diff;
templeftlocation[j] = templeftlocation[j] + diffleft[j]/diff;
  eval(layerstart+"a"+j+layerstyle+layerleft+" = document.body.scrollLeft+templeftlocation["+j+"]");
  eval(layerstart+"a"+j+layerstyle+layertop+" = document.body.scrollTop+temptoplocation["+j+"]"); }
setTimeout('run()', 25) }
badIE = 0;
browserName = navigator.appName.substring(0,8);
browserVer = parseFloat(navigator.appVersion);
macintosh = navigator.userAgent.indexOf("Mac");
if (browserName == "Microsof") { 
if (macintosh != -1) { badIE = 1; }
if (browserVer < 4) { badIE = 1; }
 }
</SCRIPT>
<STYLE type=text/css>
<!--
#a0 {position:absolute; left:-24; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a1 {position:absolute; left:96; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a2 {position:absolute; left:216; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a3 {position:absolute; left:338; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a4 {position:absolute; left:460; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a5 {position:absolute; left:640; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a6 {position:absolute; left:-24; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a7 {position:absolute; left:200; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a8 {position:absolute; left:300; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
#a9 {position:absolute; left:600; top:-24; width:9; height:25;clip:rect(0 9 9 0);z-index:2000;}
// -->
</STYLE>
<div id=a0 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a1 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a2 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a3 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a4 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a5 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a6 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a7 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a8 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
<div id=a9 align=center><IMG height=9 src="/texiao/zzsc_demo/20070604212223699.gif" width=9></div>
  • 上一个特效: 没有了
  • 下一个特效:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    姓 名: *(必填项) ·注册用户·
    Email: QQ号:
    评 分: 1分 2分 3分 4分 5分
    • 您可以发表评论支持你喜欢的文章。
    • 请遵守《互联网电子公告服务管理规定》
    • 请遵守中华人民共和国各项有关法律法规。
    • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    • 评论人需对自己在使用评论过程中的行为承担法律责任。
    • 本站管理员有权保留或删除评论内容。
    • 评论内容只代表个人观点,与本网站立场无关。
    站内特效搜索
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | | 京ICP备 05004866号 |
    版权所有 2007-2008 站长手册 WWW.ZZSC.ORG 业务联系 zzsc.org#gmail.com