아

텝메뉴 문의 드립니다.

<!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,243
13-03-01 조회 5,572
13-03-01 조회 8,315
13-03-01 조회 6,311
13-02-26 조회 3,918
13-02-26 조회 3,861
13-02-26 조회 4,759
13-02-24 조회 8,171
13-02-24 조회 4,258
13-02-24 조회 3,500
13-02-24 조회 5,316
13-02-24 조회 5,308
13-02-24 조회 4,375
13-02-24 조회 5,712
13-02-24 조회 9,400
13-02-14 조회 5,109
13-02-13 조회 9,038
13-01-29 조회 7,679
13-01-24 조회 5,029
13-01-24 조회 4,904
13-01-17 조회 4,315
13-01-16 조회 4,346
13-01-08 조회 4,399
12-12-27 조회 4,059
12-12-20 조회 1.1만
12-12-20 조회 3,382
12-12-06 조회 4,369
12-12-01 조회 4,131
12-11-28 조회 5,698
12-11-25 조회 5,405
12-10-20 조회 4,666
12-10-03 조회 4,831
12-09-26 조회 4,991
12-09-15 조회 8,444
12-09-14 조회 5,459
12-09-11 조회 3,965
12-09-10 조회 3,978
12-09-05 조회 8,861
12-08-29 조회 4,660
12-08-26 조회 3,790
12-08-23 조회 3,489
12-08-22 조회 3,576
12-08-22 조회 4,389
12-08-21 조회 3,536
12-08-20 조회 3,456
12-08-20 조회 9,259
12-08-15 조회 4,379
12-08-13 조회 3,297
12-08-11 조회 4,719
12-08-05 조회 4,565
12-08-03 조회 3,347
12-08-03 조회 4,042
12-08-02 조회 5,023
12-07-29 조회 4,132
12-07-26 조회 3,708
12-07-26 조회 3,578
12-07-22 조회 3,490
12-07-20 조회 3,325
12-07-19 조회 4,190
12-07-19 조회 3,449
12-07-16 조회 3,564
12-07-16 조회 4,485
12-07-15 조회 3,561
12-07-12 조회 7,389
12-07-12 조회 5,033
12-07-11 조회 3,077
12-07-09 조회 3,240
12-07-05 조회 3,852
12-07-04 조회 4,422
12-07-04 조회 3,828
12-07-04 조회 4,350
12-06-29 조회 3,814
12-06-27 조회 3,404
12-06-24 조회 3,881
12-06-22 조회 4,189
12-06-22 조회 8,603
12-06-22 조회 3,254
12-06-21 조회 3,287
12-06-17 조회 3,915
12-06-14 조회 4,014
12-06-14 조회 3,296
12-06-08 조회 4,444
12-06-06 조회 3,405
12-06-04 조회 4,160
12-05-26 조회 4,977
12-05-26 조회 3,932
12-05-25 조회 3,229
12-05-24 조회 3,331
12-05-22 조회 3,375
12-05-20 조회 3,003
12-05-16 조회 3,138
12-05-15 조회 3,533
12-05-10 조회 3,964
12-05-08 조회 3,486
12-05-04 조회 3,339
12-05-03 조회 4,294
12-05-02 조회 3,429
12-05-02 조회 3,204
12-05-02 조회 3,302
12-04-26 조회 3,452