얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1030 | 18년 전 | 1772 | ||
| 1029 | 18년 전 | 2204 | ||
| 1028 | 18년 전 | 2619 | ||
| 1027 | 18년 전 | 1779 | ||
| 1026 | 18년 전 | 1511 | ||
| 1025 | 18년 전 | 1528 | ||
| 1024 | 18년 전 | 1455 | ||
| 1023 | 18년 전 | 3216 | ||
| 1022 | 18년 전 | 2907 | ||
| 1021 | 18년 전 | 1663 | ||
| 1020 | 18년 전 | 3403 | ||
| 1019 | 18년 전 | 1831 | ||
| 1018 | 18년 전 | 1480 | ||
| 1017 | 18년 전 | 1940 | ||
| 1016 | 18년 전 | 2088 | ||
| 1015 | 18년 전 | 1619 | ||
| 1014 | 18년 전 | 2330 | ||
| 1013 | 18년 전 | 1990 | ||
| 1012 | 18년 전 | 1598 | ||
| 1011 | 18년 전 | 1777 | ||
| 1010 | 18년 전 | 2026 | ||
| 1009 | 18년 전 | 1786 | ||
| 1008 | 18년 전 | 1588 | ||
| 1007 | 18년 전 | 1649 | ||
| 1006 | 18년 전 | 3121 | ||
| 1005 | 18년 전 | 1984 | ||
| 1004 | 18년 전 | 1856 | ||
| 1003 | 18년 전 | 4361 | ||
| 1002 | 18년 전 | 4986 | ||
| 1001 | 18년 전 | 3153 | ||
| 1000 | 18년 전 | 2898 | ||
| 999 | 18년 전 | 3487 | ||
| 998 | 18년 전 | 2034 | ||
| 997 | 18년 전 | 2381 | ||
| 996 | 18년 전 | 2679 | ||
| 995 | 18년 전 | 2750 | ||
| 994 | 18년 전 | 2341 | ||
| 993 | 18년 전 | 1603 | ||
| 992 | 18년 전 | 3369 | ||
| 991 | 18년 전 | 1967 | ||
| 990 | 18년 전 | 2376 | ||
| 989 | 18년 전 | 2441 | ||
| 988 | 18년 전 | 2873 | ||
| 987 | 18년 전 | 5201 | ||
| 986 |
|
18년 전 | 2479 | |
| 985 |
|
18년 전 | 3319 | |
| 984 | 18년 전 | 4268 | ||
| 983 |
느낌좋은날
|
18년 전 | 2492 | |
| 982 | 18년 전 | 2454 | ||
| 981 | 18년 전 | 4028 | ||
| 980 | 18년 전 | 2744 | ||
| 979 |
Sinpre
|
19년 전 | 2982 | |
| 978 | 19년 전 | 2193 | ||
| 977 | 19년 전 | 2211 | ||
| 976 | 19년 전 | 1989 | ||
| 975 | 19년 전 | 3269 | ||
| 974 | 19년 전 | 2102 | ||
| 973 |
|
19년 전 | 2776 | |
| 972 |
|
19년 전 | 1735 | |
| 971 | 19년 전 | 5307 | ||
| 970 | 19년 전 | 3557 | ||
| 969 | 19년 전 | 4307 | ||
| 968 | 19년 전 | 3052 | ||
| 967 | 19년 전 | 2519 | ||
| 966 | 19년 전 | 3915 | ||
| 965 | 19년 전 | 2636 | ||
| 964 | 19년 전 | 2982 | ||
| 963 | 19년 전 | 2949 | ||
| 962 | 19년 전 | 4171 | ||
| 961 | 19년 전 | 3120 | ||
| 960 | 19년 전 | 3013 | ||
| 959 | 19년 전 | 3664 | ||
| 958 | 19년 전 | 2965 | ||
| 957 | 19년 전 | 2189 | ||
| 956 | 19년 전 | 2215 | ||
| 955 | 19년 전 | 2152 | ||
| 954 | 19년 전 | 2761 | ||
| 953 | 19년 전 | 2467 | ||
| 952 | 19년 전 | 3333 | ||
| 951 | 19년 전 | 3185 | ||
| 950 | 19년 전 | 1815 | ||
| 949 | 19년 전 | 2733 | ||
| 948 | 19년 전 | 7817 | ||
| 947 |
|
19년 전 | 2489 | |
| 946 |
DeepnBlue
|
19년 전 | 3095 | |
| 945 |
pearly
|
19년 전 | 2847 | |
| 944 | 19년 전 | 3007 | ||
| 943 |
|
19년 전 | 2209 | |
| 942 | 19년 전 | 2446 | ||
| 941 |
|
19년 전 | 4067 | |
| 940 | 19년 전 | 2225 | ||
| 939 |
|
19년 전 | 4214 | |
| 938 |
|
19년 전 | 2374 | |
| 937 | 19년 전 | 2069 | ||
| 936 |
|
19년 전 | 2320 | |
| 935 | 19년 전 | 1860 | ||
| 934 |
|
19년 전 | 2393 | |
| 933 | 19년 전 | 2185 | ||
| 932 |
|
19년 전 | 3057 | |
| 931 | 19년 전 | 1842 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기