아

텝메뉴 문의 드립니다.

<!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-03-03 조회 6,236
13-03-01 조회 5,565
13-03-01 조회 8,306
13-03-01 조회 6,302
13-02-26 조회 3,910
13-02-26 조회 3,855
13-02-26 조회 4,754
13-02-24 조회 8,165
13-02-24 조회 4,255
13-02-24 조회 3,495
13-02-24 조회 5,311
13-02-24 조회 5,303
13-02-24 조회 4,371
13-02-24 조회 5,709
13-02-24 조회 9,396
13-02-14 조회 5,101
13-02-13 조회 9,028
13-01-29 조회 7,673
13-01-24 조회 5,022
13-01-24 조회 4,895
13-01-17 조회 4,309
13-01-16 조회 4,335
13-01-08 조회 4,387
12-12-27 조회 4,055
12-12-20 조회 1.1만
12-12-20 조회 3,375
12-12-06 조회 4,364
12-12-01 조회 4,128
12-11-28 조회 5,690
12-11-25 조회 5,398
12-10-20 조회 4,661
12-10-03 조회 4,825
12-09-26 조회 4,988
12-09-15 조회 8,436
12-09-14 조회 5,454
12-09-11 조회 3,955
12-09-10 조회 3,976
12-09-05 조회 8,854
12-08-29 조회 4,651
12-08-26 조회 3,783
12-08-23 조회 3,484
12-08-22 조회 3,567
12-08-22 조회 4,384
12-08-21 조회 3,532
12-08-20 조회 3,450
12-08-20 조회 9,251
12-08-15 조회 4,368
12-08-13 조회 3,291
12-08-11 조회 4,715
12-08-05 조회 4,554
12-08-03 조회 3,339
12-08-03 조회 4,036
12-08-02 조회 5,015
12-07-29 조회 4,125
12-07-26 조회 3,704
12-07-26 조회 3,571
12-07-22 조회 3,483
12-07-20 조회 3,320
12-07-19 조회 4,183
12-07-19 조회 3,436
12-07-16 조회 3,554
12-07-16 조회 4,476
12-07-15 조회 3,551
12-07-12 조회 7,385
12-07-12 조회 5,024
12-07-11 조회 3,073
12-07-09 조회 3,234
12-07-05 조회 3,844
12-07-04 조회 4,417
12-07-04 조회 3,824
12-07-04 조회 4,347
12-06-29 조회 3,810
12-06-27 조회 3,396
12-06-24 조회 3,874
12-06-22 조회 4,186
12-06-22 조회 8,598
12-06-22 조회 3,248
12-06-21 조회 3,280
12-06-17 조회 3,902
12-06-14 조회 4,006
12-06-14 조회 3,285
12-06-08 조회 4,436
12-06-06 조회 3,397
12-06-04 조회 4,152
12-05-26 조회 4,973
12-05-26 조회 3,925
12-05-25 조회 3,224
12-05-24 조회 3,325
12-05-22 조회 3,371
12-05-20 조회 2,997
12-05-16 조회 3,133
12-05-15 조회 3,530
12-05-10 조회 3,960
12-05-08 조회 3,484
12-05-04 조회 3,334
12-05-03 조회 4,291
12-05-02 조회 3,424
12-05-02 조회 3,196
12-05-02 조회 3,292
12-04-26 조회 3,443