捌玖网络工作室's Archiver

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

跟随鼠标的图片代码

将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。
| j4_TIP#\lP
@1ttc q6^ [b]<html>[/b]
V6WtD!XP"PY@g [b]<head>1J+JQ] {e{
[/b]<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
l/L^@![ <title>捌玖网络网页特效|[url]www.89w.org[/url]|---跟随鼠标的图片</title>
rL%Q&]*}X [b][code]<script LANGUAGE="JavaScript">
&G/KT"_'rFvpAQ var newtop=0a:P3s4@^;D)L9H;T
var newleft=0 KzOi)R:sr.X
if (navigator.appName == "Netscape") {
oHh WZ4?d layerStyleRef="layer.";7o&dZ!P E3ez
layerRef="document.layers";`jq2|`%Y L3E
styleSwitch="";
s;|-hrS g2p)~?0H }n%\+NN x(g"m [!R
else Al J"q#dYY.h9x!m8J
{,^&W/s"c C4mtg
layerStyleRef="layer.style.";
ad Zr-AJ-m:~v layerRef="document.all";%}z+k-m7lER lb
styleSwitch=".style";4O,e*`3|bW
}
I2pI0IN4}x function doMouseMove() {
m OR k3lOS layerName = 'iit'
,Nfa|2J.u!J'` eval('var curElement='+layerRef+'["'+layerName+'"]')
v7W `3F @ eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
.OTd-L^X eval('curElement'+styleSwitch+'.visibility="visible"')
_E;pn,}|t eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')7o?2j\T0R H
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
x~k#@f eval('height=curElement'+styleSwitch+'.height')
Dn H-dj*u6R t eval('width=curElement'+styleSwitch+'.width')0W1PK\#vL*H
width=parseInt(width)zVI ?8o5Pc(ef
height=parseInt(height)*V1VX$zvZW,OU
if (event.clientX > (document.body.clientWidth - 5 - width))!e/{,Q9s J.g7h
{ ?3I#g$Yr!Ru!h(B A
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
c[,U/@8Q5bR }#~Ko [QA~
else
9Z4Rb5\ c { W|EGe@
newleft=document.body.scrollLeft + event.clientXU(JV/?)~zl
}
/k z$[G u eval('curElement'+styleSwitch+'.pixelLeft=newleft')!V:ke"yjZ
if (event.clientY > (document.body.clientHeight - 5 - height))0Zk+K sf i1w/x%|
{
J+M Uj;`H!^ newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
yIs r$rE u };JL Kv AL
else
*M S gXvp M8Q5v {i8EUB/H9iQ&[y
newtop=document.body.scrollTop + event.clientY9U0Z E(Evl Q/E
}f7M,M8o(cfH%J
eval('curElement'+styleSwitch+'.pixelTop=newtop')Wdw%P,zE_(]-d
}
7T#g-A!X Xxf0j n$[ document.onmousemove = doMouseMove; [[i&_ wd Q-`"X o
</script>V`h;?AcJ4v
[/code][/b] vg3aSH1L*j4ohc
[b]</head>[/b]V|#p3L4J9km1E2h+w
m;^\,Z7U
[b]<body>
-Tu9{@T{t;N+Q [/b]<!-- 以下代码是设定此页的鼠标样式代码 -->[K/~L8m9T5D
[b][code]<script language="javascript">
+I:K.nzy if (navigator.appName == "Netscape") {3k| {;ki1f#G6\?6X
}
X]1}#v j else:E2]?#_$]
{
y/XZCK&R Y document.write('<div ID=OuterDiv>')i9zwQjA/?
document.write('<img ID=iit src="images/flag.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')
,tU m6]2| ] document.write('</div>')
9\rIa"]{7le)A }6F(r"}C;\,}s#k
</script>
~\ [6P"v [/code][/b]
[$n R_$~1[r?h [b]</body>[/b]
V;d;Cg&I&SVO [b]</html>[/b]

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


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