얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7830 | 9년 전 | 414 | ||
| 7829 |
|
9년 전 | 601 | |
| 7828 | 9년 전 | 532 | ||
| 7827 | 9년 전 | 422 | ||
| 7826 | 9년 전 | 430 | ||
| 7825 | 10년 전 | 473 | ||
| 7824 | 10년 전 | 441 | ||
| 7823 | 10년 전 | 372 | ||
| 7822 | 10년 전 | 352 | ||
| 7821 | 10년 전 | 303 | ||
| 7820 | 10년 전 | 345 | ||
| 7819 |
|
10년 전 | 746 | |
| 7818 | 10년 전 | 382 | ||
| 7817 | 10년 전 | 512 | ||
| 7816 | 10년 전 | 402 | ||
| 7815 | 10년 전 | 605 | ||
| 7814 | 10년 전 | 423 | ||
| 7813 | 10년 전 | 367 | ||
| 7812 | 10년 전 | 391 | ||
| 7811 | 10년 전 | 388 | ||
| 7810 | 10년 전 | 559 | ||
| 7809 | 10년 전 | 484 | ||
| 7808 | 10년 전 | 375 | ||
| 7807 | 10년 전 | 399 | ||
| 7806 |
프로그래머7
|
10년 전 | 1330 | |
| 7805 | 10년 전 | 1274 | ||
| 7804 |
zahir1312
|
10년 전 | 774 | |
| 7803 |
|
10년 전 | 1366 | |
| 7802 | 10년 전 | 454 | ||
| 7801 | 10년 전 | 856 | ||
| 7800 | 10년 전 | 1081 | ||
| 7799 | 10년 전 | 550 | ||
| 7798 | 10년 전 | 502 | ||
| 7797 | 10년 전 | 497 | ||
| 7796 | 10년 전 | 346 | ||
| 7795 | 10년 전 | 498 | ||
| 7794 | 10년 전 | 543 | ||
| 7793 | 10년 전 | 1051 | ||
| 7792 | 10년 전 | 465 | ||
| 7791 | 10년 전 | 547 | ||
| 7790 | 10년 전 | 501 | ||
| 7789 |
fbastore
|
10년 전 | 1447 | |
| 7788 | 10년 전 | 538 | ||
| 7787 | 10년 전 | 395 | ||
| 7786 | 10년 전 | 575 | ||
| 7785 | 10년 전 | 577 | ||
| 7784 | 10년 전 | 636 | ||
| 7783 | 10년 전 | 439 | ||
| 7782 | 10년 전 | 487 | ||
| 7781 | 10년 전 | 895 | ||
| 7780 | 10년 전 | 809 | ||
| 7779 | 10년 전 | 771 | ||
| 7778 | 10년 전 | 363 | ||
| 7777 | 10년 전 | 445 | ||
| 7776 | 10년 전 | 455 | ||
| 7775 | 10년 전 | 403 | ||
| 7774 | 10년 전 | 630 | ||
| 7773 | 10년 전 | 378 | ||
| 7772 | 10년 전 | 727 | ||
| 7771 | 10년 전 | 375 | ||
| 7770 | 10년 전 | 641 | ||
| 7769 | 10년 전 | 372 | ||
| 7768 | 10년 전 | 601 | ||
| 7767 | 10년 전 | 1165 | ||
| 7766 | 10년 전 | 488 | ||
| 7765 | 10년 전 | 515 | ||
| 7764 |
잘살아보자
|
10년 전 | 375 | |
| 7763 |
|
10년 전 | 1452 | |
| 7762 |
Tosea
|
10년 전 | 1049 | |
| 7761 | 10년 전 | 642 | ||
| 7760 |
잘살아보자
|
10년 전 | 672 | |
| 7759 |
잘살아보자
|
10년 전 | 501 | |
| 7758 |
잘살아보자
|
10년 전 | 586 | |
| 7757 | 10년 전 | 1237 | ||
| 7756 |
ITBANK
|
10년 전 | 1250 | |
| 7755 | 10년 전 | 1924 | ||
| 7754 | 10년 전 | 1049 | ||
| 7753 | 10년 전 | 882 | ||
| 7752 | 10년 전 | 1386 | ||
| 7751 |
잘살아보자
|
10년 전 | 519 | |
| 7750 |
잘살아보자
|
10년 전 | 472 | |
| 7749 |
잘살아보자
|
10년 전 | 481 | |
| 7748 |
잘살아보자
|
10년 전 | 480 | |
| 7747 |
잘살아보자
|
10년 전 | 571 | |
| 7746 |
잘살아보자
|
10년 전 | 673 | |
| 7745 |
잘살아보자
|
10년 전 | 907 | |
| 7744 |
잘살아보자
|
10년 전 | 410 | |
| 7743 | 10년 전 | 943 | ||
| 7742 |
starbros
|
10년 전 | 832 | |
| 7741 |
잘살아보자
|
10년 전 | 668 | |
| 7740 |
잘살아보자
|
10년 전 | 526 | |
| 7739 |
잘살아보자
|
10년 전 | 463 | |
| 7738 |
잘살아보자
|
10년 전 | 527 | |
| 7737 |
잘살아보자
|
10년 전 | 496 | |
| 7736 |
잘살아보자
|
10년 전 | 515 | |
| 7735 |
잘살아보자
|
10년 전 | 848 | |
| 7734 |
잘살아보자
|
10년 전 | 424 | |
| 7733 |
잘살아보자
|
10년 전 | 541 | |
| 7732 |
잘살아보자
|
10년 전 | 693 | |
| 7731 |
잘살아보자
|
10년 전 | 618 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기