早期 IE 專屬濾鏡技術,將滑鼠游標替換為動態燃燒蠟燭動畫。僅支援 IE8 及以下,屬於「網頁特效考古」範疇,現代瀏覽器無法運行。
<body id="mybody" style="filter:light(enabled=1);" bgcolor="#ffffff">
<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, 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;
}
document.onmousemove = move_layer;
</script>
filter:light() 建立光源,addPoint/MoveLight 控制光點位置與顏色。window_onload、document_onmousemove。move_layer 讓蠟燭圖片跟隨滑鼠移動。使用 CSS cursor 屬性搭配自訂游標圖片(.cur/.ani 或 PNG + 熱點):
/* 靜態游標 */
body { cursor: url('candle.cur'), auto; }
/* 動態游標 (需 .ani 格式,僅 IE/Edge 支援) */
body { cursor: url('candle.ani'), auto; }
或用 Canvas/WebGL 繪製粒子系統跟隨滑鼠,跨瀏覽器、效能更佳。
此特效見證了 Web 早期「瀏覽器大戰」時代的私有 API。雖已淘汰,但其「光源跟隨游標」的創意仍可啟發現代 Canvas/Three.js 粒子特效設計。