捌玖网络工作室's Archiver

admin 发表于 2009-6-7 19:19

跟随鼠标的图片代码

将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。vOP|Y0x*PD

t1{ Tq j [b]<html>[/b]
"g/fB*[2o!w\&MR]4R?/|V [b]<head>zTZD$C:Za
[/b]<meta http-equiv="Content-Type" content="text/html; charset=gb2312">&?d^'l u)Cp
<title>捌玖网络网页特效|[url]www.89w.org[/url]|---跟随鼠标的图片</title>
"qso.vA-t'e [b][code]<script LANGUAGE="JavaScript">7L/sZ,n6KJC f
var newtop=0 D/gCt+V$xn
var newleft=0?TinL
if (navigator.appName == "Netscape") {)?:aZ9w ^$IJ
layerStyleRef="layer.";2_%pn&_*a1a`3QQ2F1C
layerRef="document.layers";
e.\ x1@iXc styleSwitch="";
F)E&AqO'?KU @| }
.B:k0n0Rgf else
&}0BMEVr-sc {1Qd&L WBAB Yi
layerStyleRef="layer.style.";*RKnjZj,DU c:p
layerRef="document.all";sPH$yvr_
styleSwitch=".style";qt|w.x
}8d VU8Gk?1??
function doMouseMove() {a!PL;_)Zd5g
layerName = 'iit'L8VAeTiq
eval('var curElement='+layerRef+'["'+layerName+'"]')d:s F#Y}N
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
Pe+{`HW/j eval('curElement'+styleSwitch+'.visibility="visible"')
+xy.Sdifwl eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
(jf @i8c\ eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')/BC{*I)],X
eval('height=curElement'+styleSwitch+'.height')8N rU0IO4HyiB
eval('width=curElement'+styleSwitch+'.width')
Mt"w$U*rHj width=parseInt(width)
^)B @Ul([gz height=parseInt(height)
a X[!Spv wd J-Y if (event.clientX > (document.body.clientWidth - 5 - width))W"j7G1Qg v-E-MY
{
:C-I$?;Mo [;E\#z:y newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width9QfL)El:H
}|jtZ'vS#_
elsepI[No:A0e
{X0]\0al
newleft=document.body.scrollLeft + event.clientX
2l Ym W U_4m*?!}-Q5y }
0F3z"psy.Z5~ eval('curElement'+styleSwitch+'.pixelLeft=newleft');O'l;H| ffbB:A,i
if (event.clientY > (document.body.clientHeight - 5 - height))6w:m9D(le?N;l*U aR
{c5W/L*L`1Bd
newtop=document.body.clientHeight + document.body.scrollTop - 5 - height.`j Uhey
}
P\~)b'x6r9j-s else#R wc,J ?
{
[O*vn7dZb newtop=document.body.scrollTop + event.clientY:g['B:`)aw)l
}
1Q(w%\0B3w~MR? X7S eval('curElement'+styleSwitch+'.pixelTop=newtop')0stmj3s zu
}-bt.IQbv*A
document.onmousemove = doMouseMove;#I0C I~ ?a;e e;l
</script>k2c+}Z3Z\7n:e j
[/code][/b]sj^*K.{Ukn
[b]</head>[/b]
w#QG3N]O5{.AqaH
-a-k]&]T"gU[U [b]<body>+[4s!OubDB^
[/b]<!-- 以下代码是设定此页的鼠标样式代码 -->
E j N&hW;[F V(R [b][code]<script language="javascript">
5?_F5vGR8~eH if (navigator.appName == "Netscape") {%G6S g rY
}
6S1}.S9\ nd else
k qZc ZY {U!hPt%uekp
document.write('<div ID=OuterDiv>')
k['X:{O8jP document.write('<img ID=iit src="images/flag.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')
S J`'HY]-G.|@ document.write('</div>')]zqY O
}!|J/k _o i
</script>Hl&djT{
[/code][/b]R,?W;Dq%|@
[b]</body>[/b]
8I0_]#p$Jo(L [b]</html>[/b]

页: [1]
【捌玖网络】已经运行:


Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.