클릭한 메뉴 고정하기

<!---------------------------------------------------------------------------------------
▶ 기능: 클릭한 메뉴 고정하기
---------------------------------------------------------------------------------------->
<html>
<head>
<title>http://www.01code.com[ 클릭한 메뉴 고정하기 ]</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<link rel=stylesheet href="http://www.01code.com/ydhtml/01code.css" type=text/css>
<script language=javascript>
<!--
var FixPoint = ""; //고정된 메뉴 초기화
var muNum = 3; //메인 메뉴 개수
var imgDir = "http://www.01code.com/webedition/images/"; //이미지 경로

if(document.images)
{
mu_1_0_on = new Image(); mu_1_0_on.src = imgDir + "mu_1_0_on.gif"; mu_1_0_off = new Image(); mu_1_0_off.src = imgDir + "mu_1_0_off.gif";
mu_2_0_on = new Image(); mu_2_0_on.src = imgDir + "mu_2_0_on.gif"; mu_2_0_off = new Image(); mu_2_0_off.src = imgDir + "mu_2_0_off.gif";
mu_3_0_on = new Image(); mu_3_0_on.src = imgDir + "mu_3_0_on.gif"; mu_3_0_off = new Image(); mu_3_0_off.src = imgDir + "mu_3_0_off.gif";
}
function ImgOn(imgName){
if(document.images) document[imgName].src = eval(imgName + "_on.src");
}
function ImgOff(imgName)
{
if(document.images) document[imgName].src = eval(imgName + "_off.src");
}
function SetInit()
{
SetFix('');
}
function SetFix(SetPoint)
{
if(SetPoint != ""){ FixPoint = SetPoint; }
for(i=1; i<=muNum; i++){
var imgName = "mu_" + i + "_0";
if(FixPoint == imgName){ ImgOn(imgName); }else{ ImgOff(imgName); }
}
}
//-->
</script>
</head>
<body onLoad="SetFix('mu_1_0')">
<h4>[ 클릭한 메뉴 고정하기 ]</h4>

<a href="#" onfocus=blur() onMouseOver="ImgOn('mu_1_0');" onMouseOut="SetInit();" onClick="SetFix('mu_1_0')"><img border=0 name="mu_1_0" src="http://www.01code.com/webedition/images/mu_1_0_off.gif"></a>
<a href="#" onfocus=blur() onMouseOver="ImgOn('mu_2_0');" onMouseOut="SetInit();" onClick="SetFix('mu_2_0')"><img border=0 name="mu_2_0" src="http://www.01code.com/webedition/images/mu_2_0_off.gif"></a>
<a href="#" onfocus=blur() onMouseOver="ImgOn('mu_3_0');" onMouseOut="SetInit();" onClick="SetFix('mu_3_0')"><img border=0 name="mu_3_0" src="http://www.01code.com/webedition/images/mu_3_0_off.gif"></a>

</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|

댓글 1개

질문요!!!
선택된 메뉴이미지를 두개 이상 보여주고자 할때는 어떻게 하나요?
짧게나마.. 바디에 로딩하는 이미지아이디를 하나더 추가하면 될꺼라 생각했는데.. 안되네요.
<body onLoad="SetFix('mu_1_0')"> <---------이 부분을
<body onLoad="SetFix('mu_1_0','mu_3_0')"> <---- 1번과 3번 이미지가 보여야 한다고 할때 이렇게 하면 된다고 생각했는데... 안되네요...
부탁드립니다... ㅠㅠ
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
18년 전 조회 4,357
18년 전 조회 2,600
18년 전 조회 4,954
18년 전 조회 2,782
18년 전 조회 3,662
18년 전 조회 2,614
19년 전 조회 3,427
19년 전 조회 1,938
19년 전 조회 5,368
19년 전 조회 1,687
19년 전 조회 6,046
19년 전 조회 2,865
19년 전 조회 6,031
19년 전 조회 6,825
19년 전 조회 3,717
19년 전 조회 2,197
19년 전 조회 2,091
19년 전 조회 6,889
19년 전 조회 2,389
19년 전 조회 3,942
19년 전 조회 5,328
19년 전 조회 2,674
19년 전 조회 1,730
19년 전 조회 1,567
19년 전 조회 1,513
19년 전 조회 1,788
19년 전 조회 1,781
19년 전 조회 1,773
19년 전 조회 1,710
19년 전 조회 2,500
19년 전 조회 2,302
19년 전 조회 3,461
19년 전 조회 2,588
19년 전 조회 2,566
19년 전 조회 3,407
19년 전 조회 4,621
19년 전 조회 2,958
19년 전 조회 2,797
19년 전 조회 3,343
19년 전 조회 6,276
19년 전 조회 2,178
19년 전 조회 1,982
19년 전 조회 1,934
19년 전 조회 1,997
19년 전 조회 3,185
19년 전 조회 2,255
19년 전 조회 1,945
19년 전 조회 1,620
19년 전 조회 2,071
19년 전 조회 3,356
19년 전 조회 3,223
19년 전 조회 1,901
19년 전 조회 1,473
19년 전 조회 3,170
19년 전 조회 2,045
19년 전 조회 1,611
19년 전 조회 2,832
19년 전 조회 1,960
19년 전 조회 1,835
19년 전 조회 1,808
19년 전 조회 1,775
19년 전 조회 2,198
19년 전 조회 2,618
19년 전 조회 1,776
19년 전 조회 1,514
19년 전 조회 1,526
19년 전 조회 1,452
19년 전 조회 3,217
19년 전 조회 2,907
19년 전 조회 1,662
19년 전 조회 3,399
19년 전 조회 1,827
19년 전 조회 1,476
19년 전 조회 1,941
19년 전 조회 2,084
19년 전 조회 1,619
19년 전 조회 2,324
19년 전 조회 1,978
19년 전 조회 1,590
19년 전 조회 1,772
19년 전 조회 2,026
19년 전 조회 1,777
19년 전 조회 1,581
19년 전 조회 1,645
19년 전 조회 3,111
19년 전 조회 1,983
19년 전 조회 1,853
19년 전 조회 4,353
19년 전 조회 4,981
19년 전 조회 3,143
19년 전 조회 2,875
19년 전 조회 3,479
19년 전 조회 2,026
19년 전 조회 2,376
19년 전 조회 2,675
19년 전 조회 2,748
19년 전 조회 2,338
19년 전 조회 1,600
19년 전 조회 3,369
19년 전 조회 1,962
🐛 버그신고