얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1530 |
1111111
|
18년 전 | 1957 | |
| 1529 |
행복속네잎크로버
|
18년 전 | 3462 | |
| 1528 |
행복속네잎크로버
|
18년 전 | 1835 | |
| 1527 |
1111111
|
18년 전 | 7639 | |
| 1526 |
1111111
|
18년 전 | 3285 | |
| 1525 |
행복속네잎크로버
|
18년 전 | 1269 | |
| 1524 |
행복속네잎크로버
|
18년 전 | 2301 | |
| 1523 |
행복속네잎크로버
|
18년 전 | 3506 | |
| 1522 |
행복속네잎크로버
|
18년 전 | 2360 | |
| 1521 |
행복속네잎크로버
|
18년 전 | 2138 | |
| 1520 |
행복속네잎크로버
|
18년 전 | 2762 | |
| 1519 |
행복속네잎크로버
|
18년 전 | 3721 | |
| 1518 |
행복속네잎크로버
|
18년 전 | 3484 | |
| 1517 |
행복속네잎크로버
|
18년 전 | 2566 | |
| 1516 |
행복속네잎크로버
|
18년 전 | 1913 | |
| 1515 |
행복속네잎크로버
|
18년 전 | 1935 | |
| 1514 |
행복속네잎크로버
|
18년 전 | 2511 | |
| 1513 |
행복속네잎크로버
|
18년 전 | 1986 | |
| 1512 | 18년 전 | 2873 | ||
| 1511 | 18년 전 | 1664 | ||
| 1510 | 18년 전 | 2208 | ||
| 1509 | 18년 전 | 1683 | ||
| 1508 | 18년 전 | 2137 | ||
| 1507 | 18년 전 | 2357 | ||
| 1506 | 18년 전 | 2295 | ||
| 1505 | 18년 전 | 2247 | ||
| 1504 | 18년 전 | 2177 | ||
| 1503 | 18년 전 | 3487 | ||
| 1502 | 18년 전 | 1667 | ||
| 1501 | 18년 전 | 3441 | ||
| 1500 | 18년 전 | 2025 | ||
| 1499 | 18년 전 | 5294 | ||
| 1498 | 18년 전 | 2155 | ||
| 1497 |
hsp1980
|
18년 전 | 2334 | |
| 1496 |
hsp1980
|
18년 전 | 1726 | |
| 1495 |
hsp1980
|
18년 전 | 2133 | |
| 1494 |
hsp1980
|
18년 전 | 3649 | |
| 1493 | 18년 전 | 1501 | ||
| 1492 | 18년 전 | 1743 | ||
| 1491 | 18년 전 | 4320 | ||
| 1490 | 18년 전 | 3707 | ||
| 1489 | 18년 전 | 3263 | ||
| 1488 | 18년 전 | 3365 | ||
| 1487 |
mixdesign
|
18년 전 | 3868 | |
| 1486 |
mixdesign
|
18년 전 | 4326 | |
| 1485 | 18년 전 | 4250 | ||
| 1484 | 18년 전 | 2700 | ||
| 1483 |
hsp1980
|
18년 전 | 2309 | |
| 1482 |
hsp1980
|
18년 전 | 3247 | |
| 1481 |
hsp1980
|
18년 전 | 3163 | |
| 1480 |
hsp1980
|
18년 전 | 3317 | |
| 1479 | 18년 전 | 3256 | ||
| 1478 |
|
18년 전 | 4921 | |
| 1477 |
|
18년 전 | 5207 | |
| 1476 | 18년 전 | 3406 | ||
| 1475 |
mixdesign
|
18년 전 | 2721 | |
| 1474 |
mixdesign
|
18년 전 | 2939 | |
| 1473 |
mixdesign
|
18년 전 | 2267 | |
| 1472 |
mixdesign
|
18년 전 | 2085 | |
| 1471 |
mixdesign
|
18년 전 | 2040 | |
| 1470 |
|
18년 전 | 3073 | |
| 1469 |
mixdesign
|
18년 전 | 2355 | |
| 1468 |
mixdesign
|
18년 전 | 2376 | |
| 1467 |
mixdesign
|
18년 전 | 2055 | |
| 1466 |
mixdesign
|
18년 전 | 2421 | |
| 1465 |
mixdesign
|
18년 전 | 3152 | |
| 1464 | 18년 전 | 4082 | ||
| 1463 | 18년 전 | 3372 | ||
| 1462 |
|
18년 전 | 1998 | |
| 1461 |
|
18년 전 | 1941 | |
| 1460 | 18년 전 | 2857 | ||
| 1459 | 18년 전 | 1654 | ||
| 1458 |
|
18년 전 | 2005 | |
| 1457 |
mixdesign
|
18년 전 | 2298 | |
| 1456 |
mixdesign
|
18년 전 | 2163 | |
| 1455 | 18년 전 | 2269 | ||
| 1454 | 18년 전 | 4038 | ||
| 1453 | 18년 전 | 1775 | ||
| 1452 | 18년 전 | 4391 | ||
| 1451 | 18년 전 | 2925 | ||
| 1450 | 18년 전 | 2219 | ||
| 1449 | 18년 전 | 3267 | ||
| 1448 | 18년 전 | 2898 | ||
| 1447 | 18년 전 | 2825 | ||
| 1446 | 18년 전 | 5634 | ||
| 1445 | 18년 전 | 2295 | ||
| 1444 | 18년 전 | 3410 | ||
| 1443 |
|
18년 전 | 3326 | |
| 1442 | 18년 전 | 3714 | ||
| 1441 | 18년 전 | 3266 | ||
| 1440 | 18년 전 | 2443 | ||
| 1439 | 18년 전 | 2090 | ||
| 1438 | 18년 전 | 2543 | ||
| 1437 | 18년 전 | 6111 | ||
| 1436 | 18년 전 | 2732 | ||
| 1435 | 18년 전 | 4545 | ||
| 1434 | 18년 전 | 2044 | ||
| 1433 | 18년 전 | 10033 | ||
| 1432 | 18년 전 | 2478 | ||
| 1431 |
Psychedelico
|
18년 전 | 1544 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기