얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 179 | ||
| 8229 | 9년 전 | 163 | ||
| 8228 |
커네드커네드
|
9년 전 | 201 | |
| 8227 | 9년 전 | 243 | ||
| 8226 | 9년 전 | 259 | ||
| 8225 | 9년 전 | 239 | ||
| 8224 | 9년 전 | 249 | ||
| 8223 | 9년 전 | 220 | ||
| 8222 |
|
9년 전 | 285 | |
| 8221 | 9년 전 | 186 | ||
| 8220 | 9년 전 | 227 | ||
| 8219 | 9년 전 | 199 | ||
| 8218 | 9년 전 | 244 | ||
| 8217 |
star3840
|
9년 전 | 209 | |
| 8216 | 9년 전 | 276 | ||
| 8215 | 9년 전 | 220 | ||
| 8214 | 9년 전 | 329 | ||
| 8213 | 9년 전 | 289 | ||
| 8212 | 9년 전 | 202 | ||
| 8211 | 9년 전 | 371 | ||
| 8210 | 9년 전 | 369 | ||
| 8209 | 9년 전 | 449 | ||
| 8208 | 9년 전 | 337 | ||
| 8207 | 9년 전 | 347 | ||
| 8206 |
|
9년 전 | 290 | |
| 8205 | 9년 전 | 263 | ||
| 8204 | 9년 전 | 253 | ||
| 8203 | 9년 전 | 329 | ||
| 8202 | 9년 전 | 246 | ||
| 8201 | 9년 전 | 281 | ||
| 8200 | 9년 전 | 291 | ||
| 8199 | 9년 전 | 311 | ||
| 8198 | 9년 전 | 276 | ||
| 8197 | 9년 전 | 258 | ||
| 8196 | 9년 전 | 682 | ||
| 8195 | 9년 전 | 268 | ||
| 8194 | 9년 전 | 378 | ||
| 8193 | 9년 전 | 293 | ||
| 8192 | 9년 전 | 304 | ||
| 8191 | 9년 전 | 260 | ||
| 8190 | 9년 전 | 243 | ||
| 8189 | 9년 전 | 302 | ||
| 8188 | 9년 전 | 237 | ||
| 8187 | 9년 전 | 249 | ||
| 8186 | 9년 전 | 248 | ||
| 8185 | 9년 전 | 417 | ||
| 8184 | 9년 전 | 204 | ||
| 8183 | 9년 전 | 412 | ||
| 8182 | 9년 전 | 283 | ||
| 8181 | 9년 전 | 239 | ||
| 8180 | 9년 전 | 808 | ||
| 8179 | 9년 전 | 586 | ||
| 8178 | 9년 전 | 446 | ||
| 8177 |
kiplayer
|
9년 전 | 440 | |
| 8176 | 9년 전 | 473 | ||
| 8175 | 9년 전 | 362 | ||
| 8174 | 9년 전 | 353 | ||
| 8173 | 9년 전 | 442 | ||
| 8172 | 9년 전 | 324 | ||
| 8171 | 9년 전 | 283 | ||
| 8170 | 9년 전 | 404 | ||
| 8169 |
커네드커네드
|
9년 전 | 360 | |
| 8168 | 9년 전 | 440 | ||
| 8167 | 9년 전 | 431 | ||
| 8166 | 9년 전 | 325 | ||
| 8165 | 9년 전 | 267 | ||
| 8164 | 9년 전 | 406 | ||
| 8163 | 9년 전 | 411 | ||
| 8162 | 9년 전 | 393 | ||
| 8161 | 9년 전 | 407 | ||
| 8160 |
|
9년 전 | 629 | |
| 8159 | 9년 전 | 571 | ||
| 8158 | 9년 전 | 368 | ||
| 8157 | 9년 전 | 482 | ||
| 8156 | 9년 전 | 359 | ||
| 8155 | 9년 전 | 365 | ||
| 8154 |
00년생용띠
|
9년 전 | 698 | |
| 8153 | 9년 전 | 336 | ||
| 8152 |
|
9년 전 | 514 | |
| 8151 | 9년 전 | 508 | ||
| 8150 | 9년 전 | 625 | ||
| 8149 |
Jangfolk
|
9년 전 | 481 | |
| 8148 | 9년 전 | 297 | ||
| 8147 | 9년 전 | 478 | ||
| 8146 | 9년 전 | 560 | ||
| 8145 | 9년 전 | 519 | ||
| 8144 | 9년 전 | 488 | ||
| 8143 | 9년 전 | 314 | ||
| 8142 | 9년 전 | 528 | ||
| 8141 | 9년 전 | 476 | ||
| 8140 | 9년 전 | 1039 | ||
| 8139 | 9년 전 | 384 | ||
| 8138 |
전갈자리남자
|
9년 전 | 492 | |
| 8137 | 9년 전 | 525 | ||
| 8136 | 9년 전 | 856 | ||
| 8135 |
|
9년 전 | 896 | |
| 8134 |
PlayPixel
|
9년 전 | 637 | |
| 8133 |
|
9년 전 | 544 | |
| 8132 | 9년 전 | 583 | ||
| 8131 | 9년 전 | 942 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기