网页烛光特效
分类:电脑知识 发表于:2008-08-25 22:31:28 评论(0)
<body id="mybody" style="filter:light(enabled=1);">
<div id="Layer1" style="height: 32; left: 66; position: absolute; top: 41; width: 52"><img src="images/light.gif" width="29" height="30"></div>
<script language="vbscript">
dim red,gre,blu
dim x,y,z
red=255
gre=255
blu=0
z=100
sub window_onload()
call mybody.filters.light.addPoint(0,0,z,Red,Gre,Blu,100)
mybody.style.cursor="hand"
end sub
sub document_onmousemove()
x=window.event.x
y=window.event.y
call mybody.filters.Light.MoveLight(0, x, y, 100, 1)
end sub
</script>
<script language="javascript">
//这是使图层移动的函数
function move_layer()
{
Layer1.style.left=event.clientX+document.body.scrollLeft-50;
Layer1.style.top=event.clientY+document.body.scrollTop-20;
}
//这里的意思是,如果鼠标移动时就调用"move_layer"函数
document.onmousemove =move_layer;
</script>