클릭한 메뉴 고정하기

<!---------------------------------------------------------------------------------------
▶ 기능: 클릭한 메뉴 고정하기
---------------------------------------------------------------------------------------->
<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번 이미지가 보여야 한다고 할때 이렇게 하면 된다고 생각했는데... 안되네요...
부탁드립니다... ㅠㅠ
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
19년 전 조회 4,573
19년 전 조회 2,824
19년 전 조회 5,181
19년 전 조회 3,007
19년 전 조회 3,892
19년 전 조회 2,823
19년 전 조회 3,641
19년 전 조회 2,166
19년 전 조회 5,582
19년 전 조회 1,928
19년 전 조회 6,275
19년 전 조회 3,091
19년 전 조회 6,254
19년 전 조회 7,032
19년 전 조회 3,941
19년 전 조회 2,419
19년 전 조회 2,304
19년 전 조회 7,093
19년 전 조회 2,599
19년 전 조회 4,150
19년 전 조회 5,542
19년 전 조회 2,879
19년 전 조회 1,919
19년 전 조회 1,770
19년 전 조회 1,720
19년 전 조회 1,994
19년 전 조회 2,008
19년 전 조회 1,993
19년 전 조회 1,916
19년 전 조회 2,708
19년 전 조회 2,526
19년 전 조회 3,669
19년 전 조회 2,798
19년 전 조회 2,768
19년 전 조회 3,609
19년 전 조회 4,826
19년 전 조회 3,168
19년 전 조회 3,012
19년 전 조회 3,559
19년 전 조회 6,482
19년 전 조회 2,399
19년 전 조회 2,202
19년 전 조회 2,158
19년 전 조회 2,216
19년 전 조회 3,388
19년 전 조회 2,461
19년 전 조회 2,138
19년 전 조회 1,842
19년 전 조회 2,295
19년 전 조회 3,568
19년 전 조회 3,428
19년 전 조회 2,132
19년 전 조회 1,689
19년 전 조회 3,373
19년 전 조회 2,247
19년 전 조회 1,820
19년 전 조회 3,044
19년 전 조회 2,169
19년 전 조회 2,046
19년 전 조회 2,021
19년 전 조회 1,982
19년 전 조회 2,409
19년 전 조회 2,835
19년 전 조회 1,982
19년 전 조회 1,727
19년 전 조회 1,729
19년 전 조회 1,686
19년 전 조회 3,417
19년 전 조회 3,107
19년 전 조회 1,856
19년 전 조회 3,614
19년 전 조회 2,036
19년 전 조회 1,677
19년 전 조회 2,150
19년 전 조회 2,299
19년 전 조회 1,855
19년 전 조회 2,536
19년 전 조회 2,188
19년 전 조회 1,794
19년 전 조회 1,987
19년 전 조회 2,250
19년 전 조회 2,010
19년 전 조회 1,799
19년 전 조회 1,852
19년 전 조회 3,350
19년 전 조회 2,204
19년 전 조회 2,068
19년 전 조회 4,561
19년 전 조회 5,186
19년 전 조회 3,356
19년 전 조회 3,089
19년 전 조회 3,696
19년 전 조회 2,236
19년 전 조회 2,595
19년 전 조회 2,893
19년 전 조회 2,962
19년 전 조회 2,555
19년 전 조회 1,824
19년 전 조회 3,614
19년 전 조회 2,180