捌玖网络工作室's Archiver

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

跟随鼠标的图片代码

将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。
qc}k{9w?.i V
z QhB[ DY [b]<html>[/b]
0F.mg2YiJd [b]<head> `@5drZ ei;uE
[/b]<meta http-equiv="Content-Type" content="text/html; charset=gb2312">MI"o$u\Z
<title>捌玖网络网页特效|[url]www.89w.org[/url]|---跟随鼠标的图片</title>6_I,xT5Mn
[b][code]<script LANGUAGE="JavaScript">A{)DzxrfD
var newtop=0
B:B {0\;FZ+r,I var newleft=0
M4]DC6Z7`;n6e if (navigator.appName == "Netscape") {-K4Ah8B4G C{/r{
layerStyleRef="layer.";
I5fe(`[!T/QKM layerRef="document.layers";
;v$y!wv;q\'q/~-L styleSwitch="";
2[P%S(~5@8s~uW }
#{qF)`Ne D elseJ*j#Gb/k*P%X
{
:s zV0Y FX&oB(Vq layerStyleRef="layer.style.";{;z'? z'M'{5V
layerRef="document.all";
[mxH8oa\ styleSwitch=".style";1k(S6|w,N2lU%W4i$q
}i|\;| fB3A
function doMouseMove() {{re+S:E ]XJ
layerName = 'iit'
5b(lL4B8Np9_&i,Pl eval('var curElement='+layerRef+'["'+layerName+'"]')
8E*n;Fj6neN eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')fyPUi;O1gRS
eval('curElement'+styleSwitch+'.visibility="visible"')
0d7b f0Z$W eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
e,ELR"D$V/{N eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
-u])P.q4wx i,j eval('height=curElement'+styleSwitch+'.height')
7cqm*c2h S-}x H eval('width=curElement'+styleSwitch+'.width')
7Vz%Zq||;D width=parseInt(width)
Y(YS\(M7emT-| height=parseInt(height)N@}O(|"]aB
if (event.clientX > (document.body.clientWidth - 5 - width))8h.j[5n6bV
{
,X;`aF5{ i*g newleft=document.body.clientWidth + document.body.scrollLeft - 5 - widthV)}TGuS+~)V$d
}"^ E&[*tE*}'k_
else
Ff M m.B.y!}Q { {k[{ }7L7OBG&s4R8UR
newleft=document.body.scrollLeft + event.clientXU!dEEr:C`~
}^wS[:dc6^(O&J
eval('curElement'+styleSwitch+'.pixelLeft=newleft')
\!Y$u%K7GdR X+nz JT if (event.clientY > (document.body.clientHeight - 5 - height))OO Fw^5\$P
{
6EJR\z U3b0@ newtop=document.body.clientHeight + document.body.scrollTop - 5 - height.j&]c#i,\
}
`&ae5[} else
~e6]d|(f:R {
/a:N.f K5TW%[*] newtop=document.body.scrollTop + event.clientYjJ/^ X\(X CE
}-]dCRB
eval('curElement'+styleSwitch+'.pixelTop=newtop')sA#}MW*@IU-W.wd
}(^'f,T&J.s Jy$Ry^3q8Q
document.onmousemove = doMouseMove;
8Z \N8|#kI </script>
xl&zr$IO;z [/code][/b]
b [;j:M7Oy k6NI]#b [b]</head>[/b]
JG)R7q4b1W4U1u
,t(cSD%x3pa.a;c3U [b]<body>PT?!`t*{
[/b]<!-- 以下代码是设定此页的鼠标样式代码 -->
*Qw{ H#pA.? Q [b][code]<script language="javascript">
$CvVt3h^ if (navigator.appName == "Netscape") {
W p*]ytW&bj }
D)lZ cNG rhT else2Rs!AY'Sb)?M*e
{
??$sqw5vb document.write('<div ID=OuterDiv>')
9S#C^SI document.write('<img ID=iit src="images/flag.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')@ kZ:\5O,K*x
document.write('</div>')
g.Z:h:U u|)T }dJN&R{*BK]6E Q
</script>FUC'Q6R j4v}
[/code][/b]
4oQ s0Hr+T1Z:k*F$g [b]</body>[/b]
({ WUe2H6@ [b]</html>[/b]

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


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