아

텝메뉴 문의 드립니다.

· 2012-12-31 (월) 17:34:39 · 3295 · 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-02-18 조회 3,541
13-02-15 조회 4,049
13-02-12 조회 5,824
13-02-04 조회 4,091
13-01-30 조회 4,958
13-01-25 조회 3,744
13-01-18 조회 3,769
13-01-18 조회 5,621
13-01-18 조회 6,157
13-01-18 조회 3,786
13-01-18 조회 4,857
13-01-17 조회 4,224
13-01-17 조회 3,599
13-01-17 조회 3,632
13-01-17 조회 3,976
12-12-31 조회 3,598
12-12-28 조회 4,912
12-12-28 조회 5,970
12-12-28 조회 3,414
12-12-27 조회 3,695
12-12-27 조회 4,300
12-12-20 조회 5,344
12-12-18 조회 9,152
12-12-14 조회 4,902
12-12-10 조회 3,741
12-12-10 조회 3,154
12-12-01 조회 3,951
12-11-25 조회 7,326
12-11-22 조회 5,947
12-11-20 조회 2.4만
12-11-19 조회 4,326
12-11-13 조회 3,890
12-11-12 조회 3,879
12-10-23 조회 4,829
12-09-25 조회 4,457
12-09-05 조회 7,040
12-09-04 조회 7,515
12-09-04 조회 3,432
12-08-30 조회 3,494
12-08-30 조회 3,630
12-08-29 조회 3,351
12-08-29 조회 3,193
12-08-26 조회 3,476
12-08-18 조회 3,806
12-08-17 조회 4,102
12-08-16 조회 3,623
12-08-14 조회 3,277
12-08-13 조회 5,606
12-08-13 조회 3,447
12-08-11 조회 3,752
12-08-10 조회 3,286
12-08-07 조회 4,056
12-08-07 조회 3,288
12-08-06 조회 3,492
12-07-31 조회 3,181
12-07-30 조회 3,505
12-07-30 조회 3,137
12-07-29 조회 3,314
12-07-29 조회 3,074
12-07-27 조회 3,120
12-07-21 조회 2,994
12-07-19 조회 3,211
12-07-19 조회 2,882
12-07-17 조회 3,414
12-07-17 조회 3,100
12-07-17 조회 3,969
12-07-16 조회 3,042
12-07-15 조회 3,130
12-07-14 조회 3,265
12-07-13 조회 8,322
12-07-11 조회 3,398
12-07-10 조회 9,958
12-07-09 조회 3,168
12-07-08 조회 4,421
12-07-06 조회 3,649
12-07-05 조회 3,924
12-07-05 조회 3,348
12-07-05 조회 3,307
12-07-03 조회 3,239
12-07-03 조회 3,171
12-07-02 조회 3,223
12-07-02 조회 2,932
12-06-30 조회 3,443
12-06-26 조회 3,149
12-06-22 조회 3,196
12-06-22 조회 3,147
12-06-21 조회 3,120
12-06-21 조회 3,346
12-06-20 조회 3,508
12-06-20 조회 3,172
12-06-20 조회 3,083
12-06-18 조회 3,970
12-06-17 조회 3,405
12-06-15 조회 3,015
12-06-14 조회 2,945
12-06-13 조회 3,517
12-06-11 조회 3,340
12-06-08 조회 3,349
12-06-06 조회 3,203
12-06-06 조회 3,573