跟随鼠标的图片代码
将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。vOP |Y0x*PD[b]<html>[/b]
[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>
[b][code]<script LANGUAGE="JavaScript">7L/sZ,n6KJCf
var newtop=0D/gCt+V$xn
var newleft=0?TinL
if (navigator.appName == "Netscape") {)?:aZ9w ^$IJ
layerStyleRef="layer.";2_%pn&_*a1a`3QQ2F1C
layerRef="document.layers";
styleSwitch="";
}
else
{1Qd&L WBAB Y i
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"')
eval('curElement'+styleSwitch+'.visibility="visible"')
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')/BC{*I)],X
eval('height=curElement'+styleSwitch+'.height')8N rU0IO4HyiB
eval('width=curElement'+styleSwitch+'.width')
width=parseInt(width)
height=parseInt(height)
if (event.clientX > (document.body.clientWidth - 5 - width))W"j7G1Qgv-E-MY
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width9Q fL)El:H
}|jtZ'vS#_
elsepI[No:A0e
{X0]\0al
newleft=document.body.scrollLeft + event.clientX
}
eval('curElement'+styleSwitch+'.pixelLeft=newleft');O'l;H|ffbB:A,i
if (event.clientY > (document.body.clientHeight - 5 - height))6w:m9D(le? N;l*UaR
{c5W/L*L`1Bd
newtop=document.body.clientHeight + document.body.scrollTop - 5 - height.`j U hey
}
else#Rwc,J ?
{
newtop=document.body.scrollTop + event.clientY:g['B:`)aw)l
}
eval('curElement'+styleSwitch+'.pixelTop=newtop')0stmj3s zu
}-bt.IQbv*A
document.onmousemove = doMouseMove;#I0C I~ ?a;ee;l
</script>k2c+}Z3Z\7n:e j
[/code][/b]sj^*K.{Ukn
[b]</head>[/b]
[b]<body>+[4s!OubDB^
[/b]<!-- 以下代码是设定此页的鼠标样式代码 -->
[b][code]<script language="javascript">
if (navigator.appName == "Netscape") {%G6S g rY
}
else
{U!hPt%uekp
document.write('<div ID=OuterDiv>')
document.write('<img ID=iit src="images/flag.gif" STYLE="position:absolute;TOP:5pt;LEFT:5pt;Z-INDEX:10;visibility:hidden;">')