Stage Lighting Effect

Source: Internet
Author: User

<title> Stage Lighting </title>

<style type= "Text/css" >

<!--

body{

Background-color: #000000;

}

td{

Filter:light;

}

-

</style>

<body>

<table>

<tr>

<TD id= "flttgt" ></td>

</tr>

</table>

<script language= "JavaScript" >

var g_numlights=0;

Flttgt.onclick=keyhandler; Click the mouse

Flttgt.onmousemove=mousehandler; When the mouse moves

function Setlights () {

Flttgt.filters[0].clear (); Clear all Lights First

Flttgt.filters[0].addcone ( -10,-10,5,275,370,0,0,150,60,10); Add a blue light source

if (g_numlights>0) {

Flttgt.filters[0].addcone (285,-10,5,0,370,150,0,0,60,10); Add a red light source

if (g_numlights>1)

Flttgt.filters[0].addcone (138,380,5,138,0,0,150,0,60,15); Add green light

}

}

function Keyhandler () {

g_numlights= (g_numlights+=1)%3;

Setlights ();

}

function Mousehandler () {

x= (window.event.x-80);

Y= (window.event.y-80);

Flttgt.filters[0].movelight (0,x,y,5,1); Moving Blu-ray

if (g_numlights>0) {

Flttgt.filters[0].movelight (1,x,y,5,1); Moving red light

if (g_numlights>1)

Flttgt.filters[0].movelight (2,x,y,5,1); Moving green light

}

}

Setlights ();

</script>

</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.