<style> .mydiv{ color:white; filter:light; height:300; font-size:35px; left:10px; position:relative; top:10px; 400px; } </style> <script type="text/javascript"> function init(){ document.all.div1.filters.light.addAmbient(200,10,40,30); document.all.div1.filters.light.addCone(400,400,120,160,100,255,255,80,120,5); } function move(){ document.all.div1.filters.light.moveLight(1,window.event.x-20,window.event.y,0,1); } </script> <body onload="init()" onmousemove="move()"> <div id="div1" class="mydiv"> 今天天气阴 </div> </body>
效果图: