跟随鼠标的图片代码
将以下代码分别加入到网页的<head>蓝色字体部分</head>和<body>黄色字体部分</body>区域,绿色代码表示跟随鼠标的图片,可以替换成自己的图片,注意路径一定要正确。5G6r8gl}4]*n ?
[b]<html>[/b]5Y9J2f8wF ]2dDV
[b]<head> p(^*V dcr v
[/b]<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>捌玖网络网页特效|[url]www.89w.org[/url]|---跟随鼠标的图片</title>3]L8K9j7q)X1\
[b][code]<script LANGUAGE="JavaScript">"q(m| xR}X9p%]
var newtop=0
var newleft=0
if (navigator.appName == "Netscape") {Q?+[xF2@
layerStyleRef="layer.";A'zEq5g%t8{'~
layerRef="document.layers";
styleSwitch="";2fhy g/W:gL.s4a7T
}
else!G%v5Ywc9w1a]
{ YF IJ x b J0widZ
layerStyleRef="layer.style.";
layerRef="document.all";Gb@Q j$i K
styleSwitch=".style";
}
function doMouseMove() {
layerName = 'iit'
eval('var curElement='+layerRef+'["'+layerName+'"]')f~!_0E-xp"bdrZ
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')b$JMo1s#V
eval('curElement'+styleSwitch+'.visibility="visible"')DH(Y#JK
eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')%ZW"MgXI0[
eval('height=curElement'+styleSwitch+'.height')
eval('width=curElement'+styleSwitch+'.width')1U$or3vF$Vva'a:H
width=parseInt(width)e8steu/Z*H^:X
height=parseInt(height)
if (event.clientX > (document.body.clientWidth - 5 - width))`A@?E
{
newleft=document.body.clientWidth + document.body.scrollLeft - 5 - width J2^:X5V@ D
}k'OF.G3d
elseh+I M%x6w.Dmb8\Q
{
newleft=document.body.scrollLeft + event.clientX
}eyGo*z
eval('curElement'+styleSwitch+'.pixelLeft=newleft')0B1_v_#c+U?
if (event.clientY > (document.body.clientHeight - 5 - height))IX0] yX
{#pJ[Ak.O"S:kz
newtop=document.body.clientHeight + document.body.scrollTop - 5 - heightjF D7wd0gCe!d H3M
}
else
{:k5]LWPS&P*{z'Q|
newtop=document.body.scrollTop + event.clientY
}0k Tk y&@2}~V6Mjl/Z
eval('curElement'+styleSwitch+'.pixelTop=newtop')
}yP"yO4w8B
document.onmousemove = doMouseMove;
</script>k5g tIK)n G`3V&]
[/code][/b]mN%{ af$Ep7M
[b]</head>[/b]
[b]<body>c"@X jCt2{rv%{EKA
[/b]<!-- 以下代码是设定此页的鼠标样式代码 -->(K{F?1Q&S%M_9S#F a
[b][code]<script language="javascript">;BFqt k|
if (navigator.appName == "Netscape") {
}
else)FEx*{XPi-p
{V3~8xv1W8e f,Fly
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;">')-\:q? I`}_j
document.write('</div>')R"bh!i+S*}
}!p$b-fL't.q%\*^
</script>
[/code][/b]
[b]</body>[/b]wO'OK)o;M
[b]</html>[/b]
页:
[1]