링크에 마우스 올리면 폭죽터지는 효과 > JAVA Tip

본문 바로가기
사이트 내 전체검색

JAVA Tip

링크에 마우스 올리면 폭죽터지는 효과

페이지 정보

본문

<head>와 <head> 사이에 넣는다
 
<style>
.spanstyle {
position:absolute;
visibility:hidden;
}
</style>
 
<script>
<!-- Beginning of JavaScript -
 
var debrisnumber=40
var debriscolor=new Array()
debriscolor[0]="YELLOW"
debriscolor[1]="NAVY"
debriscolor[2]="RED"
debriscolor[3]="PINK"
debriscolor[4]="ORANGE"
var x_debrispos
var y_debrispos
var x,y
var x_random=new Array()
var y_random=new Array()
var max_explsteps=20
var i_explsteps=0
var i_color=0
var pause=10
 
function checkbrowser() {
i_explsteps=0
x_debrispos=x
y_debrispos=y
for (i=0;i<=debrisnumber;i++) {
x_random[i]=Math.ceil(40*Math.random())-20
y_random[i]=Math.ceil(40*Math.random())-20
}
if (document.all) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.visibility="VISIBLE"
thisspan.posLeft=x_debrispos
thisspan.posTop=y_debrispos
}
explode_IE()
}
if (document.layers) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.visibility="VISIBLE"
thisspan.le
 
ft=x_debrispos
thisspan.top=y_debrispos
}
explode_NN()
}
}
 
function explode_IE() {
if (i_explsteps<=max_explsteps) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft+=x_random[i]
thisspan.posTop+=y_random[i]
}
i_explsteps++
var timer=setTimeout("explode_IE()",pause)
}
else {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.visibility="HIDDEN"
}
clearTimeout(timer)
}
}
 
function explode_NN() {
if (i_explsteps<=max_explsteps) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.left+=x_random[i]
thisspan.top+=y_random[i]
}
i_explsteps++
var timer=setTimeout("explode_NN()",pause)
}
else {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.visibility="HIDDEN"
}
clearTimeout(timer)
}
}
 
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
}
 
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
 
// - End of JavaScript - -->
</script>
 
<body>와 </body> 사이에 넣는다.
 
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=debrisnumber;i++) {
document.write("<div id='span"+i+"' class='spanstyle'>")
document.write("<table cellpadding=0 cellspacing=0>")
document.write("<tr><td bgcolor="+debriscolor[i_color]+">")
document.write("<img src='emptypixel236.gif' width=3>")
document.write("</td></tr></table>")
document.write("</div>")
i_color++
if (i_color>=debriscolor.length) {i_color=0}
}
// - End of JavaScript - -->
</script>
 
<body>와 <body>사이 링크걸린 글자가 들어갈 부분에 넣는다.
 
<a href="#" onMouseOver="checkbrowser()" ><b>여기에 마우스 커서를 올려보세여</b></a>

댓글목록

등록된 댓글이 없습니다.

Total 101건 3 페이지
JAVA Tip 목록
번호 제목 글쓴이 조회 날짜
69 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 3117 07-08
68 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1764 07-08
67 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 2122 07-08
66 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1477 07-08
65 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1503 07-08
64 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1749 07-08
63 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1745 07-08
62 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 2875 07-08
61 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1769 07-02
60 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 3363 07-01
59 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 2934 06-29
58 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1586 06-29
57 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 2940 06-29
열람중 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 2983 06-29
55 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1300 06-29
54 no_profile 이즈쪽지보내기 자기소개 아이디로 검색 전체게시물 1385 06-29

검색

회원로그인

회원가입

사이트 정보

컴퓨터 정보,윈도우즈,리눅스,포토샵,3ds
맥스,프로그래밍 강좌팁

접속자집계

오늘
678
어제
558
최대
5,287
전체
630,783
Copyright © www.qdata.co.kr All rights reserved.