아

텝메뉴 문의 드립니다.

· 2012-12-31 (월) 17:34:39 · 3286 · 1

<!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개

2013-01-02 (수) 10:56:30
if (navigator.userAgent.indexOf("MSIE") != -1) {

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

프로그램

8,188건
+
제목 글쓴이 날짜 조회
13-07-14 조회 5,391
13-07-14 조회 5,359
13-07-14 조회 4,639
13-07-14 조회 4,238
13-07-14 조회 4,094
13-07-14 조회 4,163
13-07-14 조회 4,876
13-07-14 조회 4,525
13-07-14 조회 4,313
13-07-14 조회 5,355
13-07-14 조회 5,231
13-07-14 조회 5,026
13-07-14 조회 4,729
13-07-14 조회 5,393
13-07-13 조회 3,568
13-07-01 조회 5,611
13-07-01 조회 5,755
13-07-01 조회 3,845
13-07-01 조회 5,202
13-05-27 조회 3,947
13-05-21 조회 4,855
13-05-02 조회 1만
13-04-29 조회 5,176
13-04-15 조회 5,439
13-04-13 조회 6,328
13-02-27 조회 3,825
13-02-26 조회 6,430
13-02-12 조회 5,014
13-02-01 조회 2.3만
13-01-23 조회 3,390
13-01-09 조회 7,989
13-01-07 조회 4,919
13-01-07 조회 3,638
13-01-04 조회 1.3만
13-01-03 조회 1.2만
12-12-31 조회 6,128
12-12-27 조회 4,424
12-12-27 조회 4,074
12-12-27 조회 8,709
12-12-18 조회 3,606
12-12-12 조회 3,665
12-12-12 조회 6,648
12-12-12 조회 8,120
12-12-05 조회 5,241
12-12-01 조회 6,648
12-11-22 조회 4,587
12-11-09 조회 5,411
12-11-09 조회 7,487
12-10-29 조회 4,749
12-10-16 조회 6,293
12-10-09 조회 5,269
12-09-02 조회 4,444
12-09-01 조회 3,537
12-08-30 조회 4,200
12-08-30 조회 4,194
12-08-28 조회 3,522
12-08-21 조회 7,137
12-08-20 조회 3,661
12-08-18 조회 5,056
12-08-18 조회 3,429
12-08-11 조회 3,587
12-08-09 조회 3,691
12-08-07 조회 3,618
12-08-07 조회 4,204
12-08-01 조회 4,544
12-08-01 조회 4,349
12-07-20 조회 9,818
12-07-17 조회 4,108
12-07-15 조회 3,902
12-07-10 조회 4,201
12-07-09 조회 6,918
12-07-05 조회 3,249
12-07-04 조회 3,412
12-06-30 조회 5,674
12-06-28 조회 3,743
12-06-20 조회 3,880
12-06-16 조회 3,157
12-06-14 조회 3,844
12-06-07 조회 3,851
12-06-06 조회 6,110
12-05-27 조회 4,401
12-05-25 조회 3,179
12-05-25 조회 3,003
12-05-24 조회 3,064
12-05-24 조회 4,508
12-05-23 조회 3,871
12-05-22 조회 6,482
12-05-15 조회 3,828
12-05-15 조회 3,612
12-05-14 조회 3,040
12-05-12 조회 3,510
12-05-11 조회 6,960
12-05-07 조회 4,409
12-04-28 조회 3,616
12-04-25 조회 5,235
12-04-15 조회 3,832
12-04-12 조회 4,670
12-04-11 조회 3,418
12-04-08 조회 3,230
12-03-21 조회 6,351