얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 394 | ||
| 7929 | 9년 전 | 301 | ||
| 7928 | 9년 전 | 400 | ||
| 7927 | 9년 전 | 320 | ||
| 7926 | 9년 전 | 652 | ||
| 7925 | 9년 전 | 336 | ||
| 7924 | 9년 전 | 316 | ||
| 7923 | 9년 전 | 332 | ||
| 7922 | 9년 전 | 351 | ||
| 7921 | 9년 전 | 387 | ||
| 7920 | 9년 전 | 307 | ||
| 7919 | 9년 전 | 327 | ||
| 7918 | 9년 전 | 481 | ||
| 7917 | 9년 전 | 323 | ||
| 7916 | 9년 전 | 394 | ||
| 7915 | 9년 전 | 392 | ||
| 7914 | 9년 전 | 397 | ||
| 7913 | 9년 전 | 546 | ||
| 7912 | 9년 전 | 398 | ||
| 7911 | 9년 전 | 348 | ||
| 7910 | 9년 전 | 385 | ||
| 7909 | 9년 전 | 490 | ||
| 7908 | 9년 전 | 403 | ||
| 7907 | 9년 전 | 346 | ||
| 7906 | 9년 전 | 368 | ||
| 7905 | 9년 전 | 347 | ||
| 7904 | 9년 전 | 334 | ||
| 7903 | 9년 전 | 331 | ||
| 7902 | 9년 전 | 538 | ||
| 7901 |
|
9년 전 | 722 | |
| 7900 | 9년 전 | 557 | ||
| 7899 | 9년 전 | 361 | ||
| 7898 | 9년 전 | 367 | ||
| 7897 | 9년 전 | 324 | ||
| 7896 | 9년 전 | 344 | ||
| 7895 | 9년 전 | 450 | ||
| 7894 | 9년 전 | 368 | ||
| 7893 | 9년 전 | 312 | ||
| 7892 | 9년 전 | 361 | ||
| 7891 | 9년 전 | 745 | ||
| 7890 | 9년 전 | 1183 | ||
| 7889 | 9년 전 | 739 | ||
| 7888 |
limsy1987
|
9년 전 | 534 | |
| 7887 | 9년 전 | 525 | ||
| 7886 | 9년 전 | 417 | ||
| 7885 | 9년 전 | 386 | ||
| 7884 | 9년 전 | 390 | ||
| 7883 | 9년 전 | 381 | ||
| 7882 | 9년 전 | 413 | ||
| 7881 | 9년 전 | 421 | ||
| 7880 | 9년 전 | 545 | ||
| 7879 | 9년 전 | 440 | ||
| 7878 | 9년 전 | 1192 | ||
| 7877 | 9년 전 | 730 | ||
| 7876 | 9년 전 | 465 | ||
| 7875 | 9년 전 | 538 | ||
| 7874 |
|
9년 전 | 796 | |
| 7873 | 9년 전 | 501 | ||
| 7872 | 9년 전 | 653 | ||
| 7871 | 9년 전 | 465 | ||
| 7870 | 9년 전 | 595 | ||
| 7869 | 9년 전 | 412 | ||
| 7868 | 9년 전 | 420 | ||
| 7867 | 9년 전 | 402 | ||
| 7866 | 9년 전 | 470 | ||
| 7865 | 9년 전 | 427 | ||
| 7864 | 9년 전 | 496 | ||
| 7863 | 9년 전 | 494 | ||
| 7862 | 9년 전 | 452 | ||
| 7861 | 9년 전 | 610 | ||
| 7860 | 9년 전 | 606 | ||
| 7859 | 9년 전 | 392 | ||
| 7858 | 9년 전 | 688 | ||
| 7857 | 9년 전 | 1049 | ||
| 7856 | 9년 전 | 498 | ||
| 7855 | 9년 전 | 725 | ||
| 7854 | 9년 전 | 711 | ||
| 7853 | 9년 전 | 566 | ||
| 7852 | 9년 전 | 488 | ||
| 7851 | 9년 전 | 484 | ||
| 7850 | 9년 전 | 570 | ||
| 7849 | 9년 전 | 341 | ||
| 7848 | 9년 전 | 394 | ||
| 7847 | 9년 전 | 627 | ||
| 7846 | 9년 전 | 437 | ||
| 7845 | 9년 전 | 393 | ||
| 7844 | 9년 전 | 378 | ||
| 7843 | 9년 전 | 396 | ||
| 7842 | 9년 전 | 381 | ||
| 7841 | 9년 전 | 369 | ||
| 7840 | 9년 전 | 381 | ||
| 7839 | 9년 전 | 417 | ||
| 7838 | 9년 전 | 499 | ||
| 7837 | 9년 전 | 340 | ||
| 7836 | 9년 전 | 379 | ||
| 7835 | 9년 전 | 456 | ||
| 7834 |
|
9년 전 | 1181 | |
| 7833 | 9년 전 | 399 | ||
| 7832 | 9년 전 | 396 | ||
| 7831 | 9년 전 | 533 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기