얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1630 | 18년 전 | 2372 | ||
| 1629 | 18년 전 | 2842 | ||
| 1628 |
인스웨이브시스템즈
|
18년 전 | 4618 | |
| 1627 | 18년 전 | 2685 | ||
| 1626 |
silence
|
18년 전 | 1879 | |
| 1625 |
|
18년 전 | 3324 | |
| 1624 | 18년 전 | 3142 | ||
| 1623 | 18년 전 | 3868 | ||
| 1622 | 18년 전 | 2178 | ||
| 1621 | 18년 전 | 2359 | ||
| 1620 | 18년 전 | 10018 | ||
| 1619 | 18년 전 | 3512 | ||
| 1618 | 18년 전 | 3313 | ||
| 1617 | 18년 전 | 3191 | ||
| 1616 |
|
18년 전 | 2806 | |
| 1615 | 18년 전 | 4168 | ||
| 1614 |
에스카르고
|
18년 전 | 5508 | |
| 1613 | 18년 전 | 3748 | ||
| 1612 | 18년 전 | 3199 | ||
| 1611 | 18년 전 | 3609 | ||
| 1610 |
DHenny
|
18년 전 | 2267 | |
| 1609 | 18년 전 | 2694 | ||
| 1608 |
|
18년 전 | 3927 | |
| 1607 | 18년 전 | 2857 | ||
| 1606 |
|
18년 전 | 4373 | |
| 1605 | 18년 전 | 2089 | ||
| 1604 |
|
18년 전 | 2536 | |
| 1603 |
|
18년 전 | 2424 | |
| 1602 |
|
18년 전 | 3782 | |
| 1601 |
|
18년 전 | 3850 | |
| 1600 | 18년 전 | 2581 | ||
| 1599 | 18년 전 | 2652 | ||
| 1598 | 18년 전 | 2987 | ||
| 1597 |
|
18년 전 | 2811 | |
| 1596 |
|
18년 전 | 2018 | |
| 1595 |
|
18년 전 | 2185 | |
| 1594 | 18년 전 | 4837 | ||
| 1593 | 18년 전 | 4180 | ||
| 1592 | 18년 전 | 2807 | ||
| 1591 | 18년 전 | 2366 | ||
| 1590 | 18년 전 | 2878 | ||
| 1589 | 18년 전 | 2345 | ||
| 1588 |
|
18년 전 | 3512 | |
| 1587 | 18년 전 | 2174 | ||
| 1586 | 18년 전 | 1970 | ||
| 1585 | 18년 전 | 1825 | ||
| 1584 | 18년 전 | 1644 | ||
| 1583 | 18년 전 | 3242 | ||
| 1582 | 18년 전 | 4561 | ||
| 1581 | 18년 전 | 4842 | ||
| 1580 |
|
18년 전 | 2133 | |
| 1579 | 18년 전 | 3583 | ||
| 1578 | 18년 전 | 3312 | ||
| 1577 | 18년 전 | 4609 | ||
| 1576 | 18년 전 | 3240 | ||
| 1575 | 18년 전 | 4243 | ||
| 1574 |
개발전문가
|
18년 전 | 3933 | |
| 1573 |
mixdesign
|
18년 전 | 3646 | |
| 1572 |
mixdesign
|
18년 전 | 3023 | |
| 1571 |
mixdesign
|
18년 전 | 2909 | |
| 1570 | 18년 전 | 3485 | ||
| 1569 |
mixdesign
|
18년 전 | 2142 | |
| 1568 |
mixdesign
|
18년 전 | 2103 | |
| 1567 | 18년 전 | 5510 | ||
| 1566 |
mixdesign
|
18년 전 | 2687 | |
| 1565 |
mixdesign
|
18년 전 | 2439 | |
| 1564 | 18년 전 | 2747 | ||
| 1563 | 18년 전 | 2080 | ||
| 1562 | 18년 전 | 3086 | ||
| 1561 | 18년 전 | 10031 | ||
| 1560 |
행복속네잎크로버
|
18년 전 | 1925 | |
| 1559 | 18년 전 | 2836 | ||
| 1558 |
1111111
|
18년 전 | 2877 | |
| 1557 |
1111111
|
18년 전 | 2129 | |
| 1556 |
1111111
|
18년 전 | 2974 | |
| 1555 |
1111111
|
18년 전 | 3983 | |
| 1554 |
1111111
|
18년 전 | 2925 | |
| 1553 |
1111111
|
18년 전 | 2301 | |
| 1552 |
1111111
|
18년 전 | 6022 | |
| 1551 |
1111111
|
18년 전 | 3652 | |
| 1550 |
1111111
|
18년 전 | 6323 | |
| 1549 |
1111111
|
18년 전 | 2414 | |
| 1548 |
1111111
|
18년 전 | 2346 | |
| 1547 |
1111111
|
18년 전 | 2381 | |
| 1546 |
1111111
|
18년 전 | 3320 | |
| 1545 |
1111111
|
18년 전 | 3174 | |
| 1544 |
1111111
|
18년 전 | 1957 | |
| 1543 |
1111111
|
18년 전 | 3693 | |
| 1542 |
1111111
|
18년 전 | 1609 | |
| 1541 |
1111111
|
18년 전 | 1353 | |
| 1540 |
1111111
|
18년 전 | 1379 | |
| 1539 |
1111111
|
18년 전 | 1533 | |
| 1538 |
1111111
|
18년 전 | 1628 | |
| 1537 |
스카이부아
|
18년 전 | 3417 | |
| 1536 |
1111111
|
18년 전 | 2248 | |
| 1535 |
1111111
|
18년 전 | 1714 | |
| 1534 |
1111111
|
18년 전 | 2098 | |
| 1533 |
1111111
|
18년 전 | 4595 | |
| 1532 |
1111111
|
18년 전 | 2334 | |
| 1531 |
1111111
|
18년 전 | 2984 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기