跟随鼠标的图片代码
将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。[b]<html>[/b]
[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
var newleft=0
if (navigator.appName == "Netscape") {-K4Ah8B4G C{/r{
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}
elseJ*j#Gb/k*P%X
{
layerStyleRef="layer.style.";{;z'?z'M'{5V
layerRef="document.all";
styleSwitch=".style";1k(S6|w,N2lU%W4i$q
}i|\;| fB3A
function doMouseMove() {{re+S:E]XJ
layerName = 'iit'
eval('var curElement='+layerRef+'["'+layerName+'"]')
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')fyPUi;O1gRS
eval('curElement'+styleSwitch+'.visibility="visible"')
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')
width=parseInt(width)
height=parseInt(height)N@}O(|"]aB
if (event.clientX > (document.body.clientWidth - 5 - width))8h.j[5n6bV
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - widthV)}TGuS+~)V$d
}"^ E&[*tE*}'k_
else
{k[{}7L7OBG&s4R8UR
newleft=document.body.scrollLeft + event.clientX