跟随鼠标的图片代码
将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。$H:e+Z O@s s:^$lPD0_n;e,cPWM[
[b]<html>[/b]jHM#G~_"\@7O M
[b]<head>
[/b]<meta http-equiv="Content-Type" content="text/html; charset=gb2312">;tdD8m$B-vd3E
<title>捌玖网络网页特效|[url]www.89w.org[/url]|---跟随鼠标的图片</title>Dy:r6qG!K0M8y0q
[b][code]<script LANGUAGE="JavaScript">%I{z!GP8r*O"f
var newtop=0"]gP}:F(r-]U
var newleft=0
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
else$W(hN1mcL2Y:O
{
layerStyleRef="layer.style.";I!J8qEk c#`h
layerRef="document.all"; k#f6i ~7F"HD
styleSwitch=".style";
}
function doMouseMove() {
layerName = 'iit'y%[^i"x.iTM
eval('var curElement='+layerRef+'["'+layerName+'"]');}5[-g2g E2m
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"') oXE-Y9[{
eval('curElement'+styleSwitch+'.visibility="visible"')P n?{?I2fx m
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
eval('height=curElement'+styleSwitch+'.height')
eval('width=curElement'+styleSwitch+'.width')6xE!ep ?&g5h
width=parseInt(width)DC Y3e,LR/r"O.i;g
height=parseInt(height)5W;~+z-i+Yl-r$s"T
if (event.clientX > (document.body.clientWidth - 5 - width))
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width
}
elsex4h,k6t$[\ M[
{