메뉴 건너뛰기

전국분동대여

일반 자료실

컴퓨터/IT 마우스를 클릭하면 불꽃놀이를 합니다

GACHIMOA 2020.07.23 19:36 조회 수 : 275

마우스를 클릭하면 불꽃놀이를 합니다

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=euc-kr">
<TITLE> Jasko Sample Script </TITLE>
<!---- [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ---->
<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:orange;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:lightgreen;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:silver;}
</style>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
var intervals=2000
var sparksOn     = true;
var speed        = 40;
var power        = 3;
var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var sparksAflyin = false;
var allDivs      = new Array(10);
var totalSparks  = 0;
function initAll(){
        if(!ns && !ie){
        sparksOn = false;
        return;
        }
setInterval("firework()",intervals)
if (ns)
        document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
        for(dNum=0; dNum<7; ++dNum){
                if(ie)
                        allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
                else
                        allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
        }
}
function firework(){
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}
else if (ns){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset
}
randomx=leftcorner+Math.floor(Math.random()*documentWidth)
randomy=topcorner+Math.floor(Math.random()*documentHeight)

        if(sparksOn){
                if(!sparksAflyin){
                        sparksAflyin=true;
                        totalSparks=0;
                        for(var spark=0;spark<=6;spark++){
                                dx=Math.round(Math.random()*50);
                                dy=Math.round(Math.random()*50);
                                moveTo(spark,randomx,randomy,dx,dy);
                        }
                }
        }
}
function moveTo(i,tempx,tempy,dx,dy){
        if(ie){
                if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))
                        tempy=document.body.offsetHeight+document.body.scrollTop-80;
                if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))
                        tempx=document.body.offsetWidth+document.body.scrollLeft-80;
        }
        if(tempx>-50&&tempy>-50){
                tempx+=dx;tempy+=dy;    
                allDivs[i].left=tempx;
                allDivs[i].top=tempy;
                dx-=power;dy-=power;
                setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)
        }
        else
                ++totalSparks
        if(totalSparks==7){
                sparksAflyin=false;
                totalSparks=0;
        }
}
window.onload=initAll;
//-->
</script>
<!------------------------- 여기까지 ---------------------------------->
</HEAD>
<BODY bgColor=black>
<!---- [2단계] 아래의 방법으로 원하는 위치에 복사 해 넣으세요 ------------------>
<div id="sDiv0">*</div>
<div id="sDiv1">*</div>
<div id="sDiv2">*</div>
<div id="sDiv3">*</div>
<div id="sDiv4">*</div>
<div id="sDiv5">*</div>
<div id="sDiv6">*</div>
<!------------------------- 여기까지 ---------------------------------->
</BODY>
</HTML>
 

번호 제목 글쓴이
3421 심장 건강에 좋은 습관 8가지 [1] 뉴퐁
3420 잠잘 때 왼쪽으로 자면 생기는 신체 변화 7가지 [2] 뉴퐁
3419 스트레스를 줄이는 놀라운 방법 6가지 [2] 싹쓰리
3418 여성이 팬티에 대해 알아야 할 7가지 [3] 싹쓰리
3417 끓였던 물을 또 끓이면 안 되는 이유 [1] 싹쓰리
3416 "치주염 환자, 코로나 감염 땐 사이토카인 폭풍 가능성 높아" [1] 쌍둥이맘
3415 스마트스토어 상위 노출 꿀팁. 경쟁률 낮은 세부키워드 뽑는 방법 [2] 나혼자번다
3414 열감지 안면인식 출입관리솔루션 400만원짜리를 40만원에(정부지원사업) [1] file 나혼자번다
3413 전자렌지요리 만능 레시피 대공개!! [3] 나혼자번다
3412 식초로 집안을 반짝반짝하게!! 식초 청소법 [4] 쌍둥이맘
3411 마시고 남은 김빠진 맥주 활용법 [2] 쌍둥이맘
3410 계란을 먹은 후 절대 바로 먹으면 안되는 것들 쌍둥이맘
3409 아주 유용한 커피상식 쌍둥이맘
3408 간 건강과 지방간 완화에 아주 효과적인 채소는? [2] 싹쓰리
3407 골다공증 예방과 뼈에 아주 좋은 음식 8가지 싹쓰리
3406 체했을 때, 감기 걸렸을 때, 관절염 통증에는 이것이 최고!! 싹쓰리
3405 장을 편안하게 하면서 소화를 돕는 식품 5가지 [1] 싹쓰리
3404 초보운전자가 반드시 알아야 하는 고속도로 운전매너 5 [1] 싹쓰리
3403 머리카락이나 두피를 상하게 하는 사소한 습관 5 라이믹스
3402 어둡고 칙칙한 피부를 환하게 해주는 필수적인 습관 5 라이믹스
위로