얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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년 전 | 533 | ||
| 8129 |
|
9년 전 | 662 | |
| 8128 | 9년 전 | 524 | ||
| 8127 |
|
9년 전 | 580 | |
| 8126 | 9년 전 | 513 | ||
| 8125 | 9년 전 | 775 | ||
| 8124 |
|
9년 전 | 531 | |
| 8123 | 9년 전 | 514 | ||
| 8122 | 9년 전 | 445 | ||
| 8121 | 9년 전 | 557 | ||
| 8120 | 9년 전 | 477 | ||
| 8119 | 9년 전 | 567 | ||
| 8118 |
|
9년 전 | 642 | |
| 8117 |
|
9년 전 | 413 | |
| 8116 |
PASKRAN
|
9년 전 | 472 | |
| 8115 | 9년 전 | 463 | ||
| 8114 |
kiplayer
|
9년 전 | 603 | |
| 8113 | 9년 전 | 463 | ||
| 8112 |
|
9년 전 | 571 | |
| 8111 | 9년 전 | 413 | ||
| 8110 | 9년 전 | 451 | ||
| 8109 | 9년 전 | 384 | ||
| 8108 |
|
9년 전 | 556 | |
| 8107 |
|
9년 전 | 449 | |
| 8106 |
|
9년 전 | 450 | |
| 8105 | 9년 전 | 482 | ||
| 8104 |
|
9년 전 | 446 | |
| 8103 |
|
9년 전 | 443 | |
| 8102 |
|
9년 전 | 417 | |
| 8101 |
snshero
|
9년 전 | 803 | |
| 8100 | 9년 전 | 850 | ||
| 8099 | 9년 전 | 827 | ||
| 8098 | 9년 전 | 724 | ||
| 8097 | 9년 전 | 531 | ||
| 8096 | 9년 전 | 728 | ||
| 8095 | 9년 전 | 855 | ||
| 8094 | 9년 전 | 530 | ||
| 8093 | 9년 전 | 812 | ||
| 8092 | 9년 전 | 767 | ||
| 8091 | 9년 전 | 1151 | ||
| 8090 | 9년 전 | 779 | ||
| 8089 | 9년 전 | 991 | ||
| 8088 | 9년 전 | 655 | ||
| 8087 | 9년 전 | 780 | ||
| 8086 | 9년 전 | 529 | ||
| 8085 | 9년 전 | 495 | ||
| 8084 | 9년 전 | 615 | ||
| 8083 | 9년 전 | 585 | ||
| 8082 | 9년 전 | 771 | ||
| 8081 | 9년 전 | 482 | ||
| 8080 | 9년 전 | 583 | ||
| 8079 | 9년 전 | 541 | ||
| 8078 | 9년 전 | 458 | ||
| 8077 | 9년 전 | 547 | ||
| 8076 | 9년 전 | 419 | ||
| 8075 | 9년 전 | 452 | ||
| 8074 | 9년 전 | 412 | ||
| 8073 | 9년 전 | 467 | ||
| 8072 | 9년 전 | 462 | ||
| 8071 |
o1o111
|
9년 전 | 908 | |
| 8070 | 9년 전 | 416 | ||
| 8069 | 9년 전 | 355 | ||
| 8068 | 9년 전 | 607 | ||
| 8067 | 9년 전 | 407 | ||
| 8066 | 9년 전 | 433 | ||
| 8065 | 9년 전 | 398 | ||
| 8064 | 9년 전 | 383 | ||
| 8063 | 9년 전 | 354 | ||
| 8062 | 9년 전 | 321 | ||
| 8061 | 9년 전 | 360 | ||
| 8060 | 9년 전 | 401 | ||
| 8059 | 9년 전 | 338 | ||
| 8058 | 9년 전 | 269 | ||
| 8057 | 9년 전 | 399 | ||
| 8056 | 9년 전 | 318 | ||
| 8055 | 9년 전 | 366 | ||
| 8054 | 9년 전 | 376 | ||
| 8053 | 9년 전 | 427 | ||
| 8052 | 9년 전 | 302 | ||
| 8051 | 9년 전 | 350 | ||
| 8050 | 9년 전 | 400 | ||
| 8049 | 9년 전 | 336 | ||
| 8048 | 9년 전 | 443 | ||
| 8047 | 9년 전 | 380 | ||
| 8046 | 9년 전 | 324 | ||
| 8045 | 9년 전 | 272 | ||
| 8044 | 9년 전 | 356 | ||
| 8043 | 9년 전 | 308 | ||
| 8042 | 9년 전 | 306 | ||
| 8041 | 9년 전 | 366 | ||
| 8040 | 9년 전 | 289 | ||
| 8039 | 9년 전 | 327 | ||
| 8038 | 9년 전 | 279 | ||
| 8037 | 9년 전 | 418 | ||
| 8036 | 9년 전 | 504 | ||
| 8035 | 9년 전 | 442 | ||
| 8034 | 9년 전 | 400 | ||
| 8033 | 9년 전 | 362 | ||
| 8032 | 9년 전 | 461 | ||
| 8031 | 9년 전 | 362 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기