얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
onMouseover 와 onMouseout에 this객체만 넣어주시면 됩니다.
많은 태클과 개선점 제시해 주시면 감사하겠습니다.
----------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
.hym{
color:black;
font-weight:400;
margin:10px 0px 10px 0px;
cursor:help;
width:140px;
height:25px;
padding:3px;
border:1px solid red;
background-color:lightyellow;
}
</style>
<script language="javascript">
var colorArray = ["#cedfff","#b0acff","#ee311c","#8e60dd","#c875b5","#de8faf","#25dc8e","#61e274","#becb21","#dd7ce4"];
var display;
var colorNum = 0;
function setColor(aObj){
temp = 'setInterval(function(){ showColor(aObj); },60)';
display = eval(temp);
}
function showColor(aObj){
colorNum = colorNum == colorArray.length -1 ? 0:colorNum+=1;
aObj.style.color=colorArray[colorNum];
aObj.style.fontWeight = 700;
}
function BreakColor(aObj){
clearInterval(display);
aObj.style.fontWeight = 400;
aObj.style.color="black";
}
</script>
</head>
<body>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Change Color..</div>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Style Color...</div>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Bye Bye Bye...</div>
</body>
</html>
onMouseover 와 onMouseout에 this객체만 넣어주시면 됩니다.
많은 태클과 개선점 제시해 주시면 감사하겠습니다.
----------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
.hym{
color:black;
font-weight:400;
margin:10px 0px 10px 0px;
cursor:help;
width:140px;
height:25px;
padding:3px;
border:1px solid red;
background-color:lightyellow;
}
</style>
<script language="javascript">
var colorArray = ["#cedfff","#b0acff","#ee311c","#8e60dd","#c875b5","#de8faf","#25dc8e","#61e274","#becb21","#dd7ce4"];
var display;
var colorNum = 0;
function setColor(aObj){
temp = 'setInterval(function(){ showColor(aObj); },60)';
display = eval(temp);
}
function showColor(aObj){
colorNum = colorNum == colorArray.length -1 ? 0:colorNum+=1;
aObj.style.color=colorArray[colorNum];
aObj.style.fontWeight = 700;
}
function BreakColor(aObj){
clearInterval(display);
aObj.style.fontWeight = 400;
aObj.style.color="black";
}
</script>
</head>
<body>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Change Color..</div>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Style Color...</div>
<div class="hym" onMouseover="setColor(this);" onMouseout="BreakColor(this);">Bye Bye Bye...</div>
</body>
</html>
[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8130 | 9년 전 | 566 | ||
| 8129 |
|
9년 전 | 684 | |
| 8128 | 9년 전 | 539 | ||
| 8127 |
|
9년 전 | 588 | |
| 8126 | 9년 전 | 521 | ||
| 8125 | 9년 전 | 777 | ||
| 8124 |
|
9년 전 | 533 | |
| 8123 | 9년 전 | 520 | ||
| 8122 | 9년 전 | 451 | ||
| 8121 | 9년 전 | 559 | ||
| 8120 | 9년 전 | 480 | ||
| 8119 | 9년 전 | 569 | ||
| 8118 |
|
9년 전 | 642 | |
| 8117 |
|
9년 전 | 415 | |
| 8116 |
PASKRAN
|
9년 전 | 474 | |
| 8115 | 9년 전 | 467 | ||
| 8114 |
kiplayer
|
9년 전 | 605 | |
| 8113 | 9년 전 | 465 | ||
| 8112 |
|
9년 전 | 573 | |
| 8111 | 9년 전 | 414 | ||
| 8110 | 9년 전 | 456 | ||
| 8109 | 9년 전 | 385 | ||
| 8108 |
|
9년 전 | 563 | |
| 8107 |
|
9년 전 | 451 | |
| 8106 |
|
9년 전 | 453 | |
| 8105 | 9년 전 | 483 | ||
| 8104 |
|
9년 전 | 448 | |
| 8103 |
|
9년 전 | 446 | |
| 8102 |
|
9년 전 | 420 | |
| 8101 |
snshero
|
9년 전 | 806 | |
| 8100 | 9년 전 | 852 | ||
| 8099 | 9년 전 | 830 | ||
| 8098 | 9년 전 | 728 | ||
| 8097 | 9년 전 | 536 | ||
| 8096 | 9년 전 | 734 | ||
| 8095 | 9년 전 | 863 | ||
| 8094 | 9년 전 | 535 | ||
| 8093 | 9년 전 | 819 | ||
| 8092 | 9년 전 | 771 | ||
| 8091 | 9년 전 | 1154 | ||
| 8090 | 9년 전 | 782 | ||
| 8089 | 9년 전 | 996 | ||
| 8088 | 9년 전 | 659 | ||
| 8087 | 9년 전 | 787 | ||
| 8086 | 9년 전 | 535 | ||
| 8085 | 9년 전 | 498 | ||
| 8084 | 9년 전 | 618 | ||
| 8083 | 9년 전 | 589 | ||
| 8082 | 9년 전 | 778 | ||
| 8081 | 9년 전 | 486 | ||
| 8080 | 9년 전 | 585 | ||
| 8079 | 9년 전 | 545 | ||
| 8078 | 9년 전 | 463 | ||
| 8077 | 9년 전 | 553 | ||
| 8076 | 9년 전 | 422 | ||
| 8075 | 9년 전 | 457 | ||
| 8074 | 9년 전 | 418 | ||
| 8073 | 9년 전 | 473 | ||
| 8072 | 9년 전 | 467 | ||
| 8071 |
o1o111
|
9년 전 | 915 | |
| 8070 | 9년 전 | 422 | ||
| 8069 | 9년 전 | 360 | ||
| 8068 | 9년 전 | 615 | ||
| 8067 | 9년 전 | 412 | ||
| 8066 | 9년 전 | 437 | ||
| 8065 | 9년 전 | 400 | ||
| 8064 | 9년 전 | 392 | ||
| 8063 | 9년 전 | 359 | ||
| 8062 | 9년 전 | 327 | ||
| 8061 | 9년 전 | 367 | ||
| 8060 | 9년 전 | 405 | ||
| 8059 | 9년 전 | 340 | ||
| 8058 | 9년 전 | 279 | ||
| 8057 | 9년 전 | 406 | ||
| 8056 | 9년 전 | 324 | ||
| 8055 | 9년 전 | 372 | ||
| 8054 | 9년 전 | 381 | ||
| 8053 | 9년 전 | 432 | ||
| 8052 | 9년 전 | 306 | ||
| 8051 | 9년 전 | 354 | ||
| 8050 | 9년 전 | 409 | ||
| 8049 | 9년 전 | 342 | ||
| 8048 | 9년 전 | 449 | ||
| 8047 | 9년 전 | 384 | ||
| 8046 | 9년 전 | 329 | ||
| 8045 | 9년 전 | 275 | ||
| 8044 | 9년 전 | 361 | ||
| 8043 | 9년 전 | 316 | ||
| 8042 | 9년 전 | 308 | ||
| 8041 | 9년 전 | 371 | ||
| 8040 | 9년 전 | 294 | ||
| 8039 | 9년 전 | 336 | ||
| 8038 | 9년 전 | 281 | ||
| 8037 | 9년 전 | 424 | ||
| 8036 | 9년 전 | 513 | ||
| 8035 | 9년 전 | 446 | ||
| 8034 | 9년 전 | 406 | ||
| 8033 | 9년 전 | 367 | ||
| 8032 | 9년 전 | 469 | ||
| 8031 | 9년 전 | 364 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기