아

텝메뉴 문의 드립니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>텝메뉴</title>
<script language="javascript">
 
function menu1(index) {
 if (navigator.userAgent.indexOf("MSIE") != -1) {
  if (index == 1) {
   t1.style.display = "";
   t2.style.display = "none";
   t3.style.display = "none";
   t4.style.display = "none";
  }
  else if(index == 2){
   t1.style.display = "none";
   t2.style.display = "";
   t3.style.display = "none";
   t4.style.display = "none";
  }
  else if(index == 3){
   t1.style.display = "none";
   t2.style.display = "none";
   t3.style.display = "";
   t4.style.display = "none";
  }
 
   else if(index == 4){
   t1.style.display = "none";
   t2.style.display = "none";
   t3.style.display = "none";
   t4.style.display = "";
  }
 }
}
</script>
</head>
<body>
<br /><br /><br />
 
<div id=t1>
 <table width="300" border="0">
  <tr height="30" align="center">
   <td width="150" bgcolor="#CCCCCC">MENU1</td>
   <td bgcolor="#EEEEEE"><a href="javascript:menu1(2);" onFocus="this.blur()">MENU2</a></td>
   <td bgcolor="#EEEEEE"><a href="javascript:menu1(3);" onFocus="this.blur()">MENU3</a></td>
   <td bgcolor="#EEEEEE"><a href="javascript:menu1(4);" onFocus="this.blur()">MENU4</a></td>
  </tr>
  <tr height="100">
   <td colspan="4" bgcolor="red">
    Content 1
   </td>
  </tr>
 </table>
</div>
 
<div id=t2 style="display:none">
 <table width="300" border="0">
  <tr height="30" align="center">
   <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(1);" onFocus="this.blur()">MENU1</a></td>
   <td bgcolor="#CCCCCC">MENU2</td>
      <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(3);" onFocus="this.blur()">MENU3</a></td>
         <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(4);" onFocus="this.blur()">MENU4</a></td>
  </tr>
  <tr height="100">
   <td colspan="4" bgcolor="blue">
   Content 2
   </td>
  </tr>
 </table>
</div>


<div id=t3 style="display:none">
 <table width="300" border="0">
  <tr height="30" align="center">
   <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(1);" onFocus="this.blur()">MENU1</a></td>
   <td bgcolor="#EEEEEE"><a href="javascript:menu1(2);" onFocus="this.blur()">MENU2</a></td>
      <td width="150"bgcolor="#CCCCCC">MENU3</td>
         <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(4);" onFocus="this.blur()">MENU4</a></td>
  </tr>
  <tr height="100">
   <td colspan="4" bgcolor="black">
   Content 3
   </td>
  </tr>
 </table>
</div>

<div id=t4 style="display:none">
 <table width="300" border="0">
  <tr height="30" align="center">
   <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(1);" onFocus="this.blur()">MENU1</a></td>
   <td bgcolor="#EEEEEE"><a href="javascript:menu1(2);" onFocus="this.blur()">MENU2</a></td>
      <td width="150" bgcolor="#EEEEEE"><a href="javascript:menu1(3);" onFocus="this.blur()">MENU3</a></td>
         <td width="150" bgcolor="#CCCCCC">MENU4</td>
  </tr>
  <tr height="100">
   <td colspan="4" bgcolor="black">
   Content 4
   </td>
  </tr>
 </table>
</div>
 
<br /><br /><br />
</body>
</html>   



이상 소스구요..
익스플로러 9에서는 보이는데 파이어폭스에서는 적용이 안되네요...
이유가 뭘까요..
답변 부탁드립니다...

|

댓글 1개

if (navigator.userAgent.indexOf("MSIE") != -1) {

조건이 걸려이네요. 익스일때만 작동해라 라는 식으로 저줄하고 하단의 } 를 삭제해서 조건을 빼주니 다른브라우저에서도 작동하네요.
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
13-07-14 조회 5,480
13-07-14 조회 5,443
13-07-14 조회 4,752
13-07-14 조회 4,344
13-07-14 조회 4,211
13-07-14 조회 4,261
13-07-14 조회 4,994
13-07-14 조회 4,704
13-07-14 조회 4,412
13-07-14 조회 5,454
13-07-14 조회 5,351
13-07-14 조회 5,115
13-07-14 조회 4,849
13-07-14 조회 5,531
13-07-13 조회 3,789
13-07-01 조회 5,804
13-07-01 조회 5,885
13-07-01 조회 3,984
13-07-01 조회 5,486
13-05-27 조회 4,051
13-05-21 조회 5,108
13-05-02 조회 1만
13-04-29 조회 5,281
13-04-15 조회 5,522
13-04-13 조회 6,456
13-02-27 조회 4,173
13-02-26 조회 6,554
13-02-12 조회 5,321
13-02-01 조회 2.4만
13-01-23 조회 3,601
13-01-09 조회 8,091
13-01-07 조회 5,004
13-01-07 조회 3,742
13-01-04 조회 1.3만
13-01-03 조회 1.2만
12-12-31 조회 6,450
12-12-27 조회 4,575
12-12-27 조회 4,265
12-12-27 조회 8,939
12-12-18 조회 3,752
12-12-12 조회 3,786
12-12-12 조회 6,812
12-12-12 조회 8,225
12-12-05 조회 5,529
12-12-01 조회 6,836
12-11-22 조회 4,761
12-11-09 조회 5,603
12-11-09 조회 7,650
12-10-29 조회 4,871
12-10-16 조회 6,408
12-10-09 조회 5,498
12-09-02 조회 4,593
12-09-01 조회 3,705
12-08-30 조회 4,371
12-08-30 조회 4,374
12-08-28 조회 3,707
12-08-21 조회 7,271
12-08-20 조회 3,800
12-08-18 조회 5,216
12-08-18 조회 3,582
12-08-11 조회 3,737
12-08-09 조회 3,905
12-08-07 조회 3,885
12-08-07 조회 4,467
12-08-01 조회 4,726
12-08-01 조회 4,611
12-07-20 조회 9,978
12-07-17 조회 4,327
12-07-15 조회 4,097
12-07-10 조회 4,364
12-07-09 조회 7,082
12-07-05 조회 3,418
12-07-04 조회 3,554
12-06-30 조회 5,805
12-06-28 조회 3,895
12-06-20 조회 4,070
12-06-16 조회 3,364
12-06-14 조회 4,012
12-06-07 조회 4,036
12-06-06 조회 6,393
12-05-27 조회 4,613
12-05-25 조회 3,354
12-05-25 조회 3,194
12-05-24 조회 3,291
12-05-24 조회 4,639
12-05-23 조회 4,024
12-05-22 조회 6,637
12-05-15 조회 4,156
12-05-15 조회 3,711
12-05-14 조회 3,150
12-05-12 조회 3,608
12-05-11 조회 7,101
12-05-07 조회 4,546
12-04-28 조회 3,736
12-04-25 조회 5,386
12-04-15 조회 3,973
12-04-12 조회 4,819
12-04-11 조회 3,578
12-04-08 조회 3,426
12-03-21 조회 6,477