얼마전, 어느 블로그에서 구현되었던걸 보고서 공부겸 만들어 보았습니다.
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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1830 |
갈색야생마
|
17년 전 | 2845 | |
| 1829 |
갈색야생마
|
17년 전 | 1593 | |
| 1828 |
갈색야생마
|
17년 전 | 1351 | |
| 1827 |
갈색야생마
|
17년 전 | 2017 | |
| 1826 |
갈색야생마
|
17년 전 | 1465 | |
| 1825 |
갈색야생마
|
17년 전 | 1406 | |
| 1824 |
갈색야생마
|
17년 전 | 1354 | |
| 1823 |
갈색야생마
|
17년 전 | 1563 | |
| 1822 |
갈색야생마
|
17년 전 | 2049 | |
| 1821 |
갈색야생마
|
17년 전 | 1436 | |
| 1820 |
갈색야생마
|
17년 전 | 1408 | |
| 1819 |
갈색야생마
|
17년 전 | 1212 | |
| 1818 |
갈색야생마
|
17년 전 | 1440 | |
| 1817 |
갈색야생마
|
17년 전 | 1169 | |
| 1816 |
갈색야생마
|
17년 전 | 1301 | |
| 1815 |
갈색야생마
|
17년 전 | 1559 | |
| 1814 |
갈색야생마
|
17년 전 | 1394 | |
| 1813 |
갈색야생마
|
17년 전 | 1294 | |
| 1812 |
갈색야생마
|
17년 전 | 1262 | |
| 1811 |
갈색야생마
|
17년 전 | 1378 | |
| 1810 |
갈색야생마
|
17년 전 | 1154 | |
| 1809 |
갈색야생마
|
17년 전 | 1208 | |
| 1808 |
갈색야생마
|
17년 전 | 1239 | |
| 1807 |
갈색야생마
|
17년 전 | 1313 | |
| 1806 |
갈색야생마
|
17년 전 | 1339 | |
| 1805 |
갈색야생마
|
17년 전 | 1342 | |
| 1804 |
갈색야생마
|
17년 전 | 1305 | |
| 1803 |
갈색야생마
|
17년 전 | 1626 | |
| 1802 | 17년 전 | 2961 | ||
| 1801 | 17년 전 | 3357 | ||
| 1800 | 17년 전 | 1454 | ||
| 1799 | 17년 전 | 1549 | ||
| 1798 | 17년 전 | 1363 | ||
| 1797 | 17년 전 | 2119 | ||
| 1796 | 17년 전 | 3036 | ||
| 1795 | 17년 전 | 1378 | ||
| 1794 | 17년 전 | 1373 | ||
| 1793 |
갈색야생마
|
17년 전 | 1372 | |
| 1792 |
갈색야생마
|
17년 전 | 1221 | |
| 1791 |
갈색야생마
|
17년 전 | 1415 | |
| 1790 |
갈색야생마
|
17년 전 | 1474 | |
| 1789 |
갈색야생마
|
17년 전 | 1282 | |
| 1788 |
갈색야생마
|
17년 전 | 2565 | |
| 1787 |
갈색야생마
|
17년 전 | 1313 | |
| 1786 |
갈색야생마
|
17년 전 | 1589 | |
| 1785 |
갈색야생마
|
17년 전 | 1461 | |
| 1784 |
갈색야생마
|
17년 전 | 1771 | |
| 1783 |
갈색야생마
|
17년 전 | 1795 | |
| 1782 | 17년 전 | 1806 | ||
| 1781 | 17년 전 | 1851 | ||
| 1780 | 17년 전 | 1512 | ||
| 1779 | 17년 전 | 1603 | ||
| 1778 |
갈색야생마
|
17년 전 | 1513 | |
| 1777 |
갈색야생마
|
17년 전 | 1861 | |
| 1776 |
갈색야생마
|
17년 전 | 1766 | |
| 1775 |
갈색야생마
|
17년 전 | 1561 | |
| 1774 |
갈색야생마
|
17년 전 | 1740 | |
| 1773 |
갈색야생마
|
17년 전 | 1408 | |
| 1772 |
갈색야생마
|
17년 전 | 1639 | |
| 1771 |
갈색야생마
|
17년 전 | 1960 | |
| 1770 |
갈색야생마
|
17년 전 | 2789 | |
| 1769 | 17년 전 | 1997 | ||
| 1768 | 17년 전 | 1409 | ||
| 1767 | 17년 전 | 1950 | ||
| 1766 | 17년 전 | 2404 | ||
| 1765 | 17년 전 | 1561 | ||
| 1764 | 17년 전 | 2325 | ||
| 1763 |
sini117
|
17년 전 | 1761 | |
| 1762 |
sini117
|
17년 전 | 1466 | |
| 1761 |
nooree
|
17년 전 | 1323 | |
| 1760 | 17년 전 | 1994 | ||
| 1759 | 17년 전 | 2884 | ||
| 1758 | 17년 전 | 2503 | ||
| 1757 | 17년 전 | 1529 | ||
| 1756 | 17년 전 | 2873 | ||
| 1755 | 17년 전 | 2408 | ||
| 1754 | 17년 전 | 2754 | ||
| 1753 | 17년 전 | 2766 | ||
| 1752 | 17년 전 | 2554 | ||
| 1751 | 17년 전 | 2368 | ||
| 1750 | 17년 전 | 1725 | ||
| 1749 | 17년 전 | 2459 | ||
| 1748 | 17년 전 | 3959 | ||
| 1747 |
|
17년 전 | 1836 | |
| 1746 | 17년 전 | 3923 | ||
| 1745 | 17년 전 | 1851 | ||
| 1744 | 17년 전 | 1739 | ||
| 1743 | 17년 전 | 2070 | ||
| 1742 | 17년 전 | 2483 | ||
| 1741 | 17년 전 | 1440 | ||
| 1740 | 17년 전 | 1777 | ||
| 1739 | 17년 전 | 2335 | ||
| 1738 | 17년 전 | 1811 | ||
| 1737 | 17년 전 | 1768 | ||
| 1736 | 17년 전 | 1545 | ||
| 1735 | 17년 전 | 1387 | ||
| 1734 | 17년 전 | 1345 | ||
| 1733 | 17년 전 | 1163 | ||
| 1732 | 17년 전 | 1151 | ||
| 1731 | 17년 전 | 1178 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기