2013-02-02 5 views
0

우리 모두 알고 있듯이 IE는 대부분의 다른 브라우저 유형만큼 프로그레시브가 아니며 이로 인해 큰 두통이 생깁니다. 그래서 필자는 필자가 템플릿을 작성해야하는 웹 사이트 프로젝트를 마쳤지 만 Internet Explorer에서 4 개의 링크가 코드의 "fadeIn"부분을 열지 않습니다.IE에서 jQuery "fadeIn"이 작동하지 않는 이유는 무엇입니까?

아무도 내가 잘못 가서 얘기 할 수 있습니까?! xoxoxoxoox


구조 :

body 
{ 
    margin: 0; 
    padding: 0; 
    height:100%; 
    width:100%; 
    background-color: #FFF; 
    z-index:-1; 
} 
#content 
{ 
    width: 100%; 
    height: 640px; 
    background-color:#060; 
    z-index:20; 
    position:relative; 
} 
#content-inner 
{ 
    width: 960px; 
    height: 640px; 
    background-color:#666; 
    margin-left:auto; 
    margin-right:auto; 
    z-index:-1; 
    position:relative; 
} 

#hidebar 
{ 
    width: 100%; 
    height: 290px; 
    background-color:#000; 
    position:absolute; 
    z-index:2; 
    bottom:0; 
    left:0; 
    display:none; 
} 

#jqb1 
{ 
    margin-left:auto; 
    margin-right:auto; 
    width:960px; 
    height:100%; 
    background-color:#F00; 
    display:none; 
} 
#jqb2 
{ 
    margin-left:auto; 
    margin-right:auto; 
    width:960px; 
    height:100%; 
    background-color:#00F; 
    display:none; 
} 
#jqb3 
{ 
    margin-left:auto; 
    margin-right:auto; 
    width:960px; 
    height:100%; 
    background-color:#9F3; 
    display:none; 
} 
#jqb4 
{ 
    margin-left:auto; 
    margin-right:auto; 
    width:960px; 
    height:100%; 
    background-color:#360; 
    display:none; 
} 



#navbar 
{ 
    width: 100%; 
    height: 257px; 
    background-color:#F00; 
} 
#navbar-inner 
{ 
    width: 960px; 
    height: 257px; 
    background-color:#666; 
    margin-left:auto; 
    margin-right:auto; 
    position:relative; 
} 

#footer 
{ 
    width: 100%; 
    height: 181px; 
    background-image:url(images/gray-pixel.png); 
    position:relative; 
} 
#footer-inner 
{ 
    width: 960px; 
    height: 181px; 
    background-color:#666; 
    margin-left:auto; 
    margin-right:auto; 
    position:relative; 
} 
#footer-small 
{ 
    width:230px; 
    float:left; 
    height:100%; 
    background-color:#999; 
    position:relative; 
} 
#footer-large 
{ 
    width:500px; 
    float:left; 
    height:100%; 
    background-color:#CCC; 
    position:relative; 
} 
#colour-bar 
{ 
    width: 100%; 
    height: 13px; 
    background-color:#639; 
    position:relative; 
} 


html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote,  pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s,  samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,  fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article,  aside, details, figcaption, figure, footer, header, hgroup, mark, menu, meter, nav, output,  progress, section, summary, time { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    outline: 0; 
    font-size: 100%; 
    vertical-align: baseline; 
    background: transparent; 
} 
ul { 
    list-style-type:none; 
} 
ul li a{ 
    font:700 49px/1.2em Arial, Helvetica, sans-serif; 
    color:#fff; 
    text-decoration:none; 
    height:59px; 
    display:inline-block; 
    list-style-type:none; 
    text-align:center; 
    position::relative; 
    vertical-align: baseline; 
} 

ul li a:hover{ 
    color:#e25709; 
} 
div.table 
{ 
    border: 0px solid black; 
    display: table; 
    margin-left:auto; 
    margin-right:auto; 
} 
div.tr {border: 0px solid black; display: table-row; } 
div.td {border: 0px solid black; display: table-cell; } 




h3 
{ 
    color:#FFF; 
    font-size:22px; 
    font-family:Arial, Helvetica, sans-serif; 
    padding-top:30px; 
    padding-left:25px; 
    padding-bottom:20px; 
} 

h4 
{ 
    color:#FFF; 
    font-size:13px; 
    font-style:normal; 
    font-family:Arial, Helvetica, sans-serif; 
    padding-left:25px; 
    padding-right:25px; 
    line-height:1.2em; 
} 



인덱스 페이지 :

<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title></title> 
<link rel="stylesheet" type="text/css" href="css/structure.css"/> 
<script src="http://code.jquery.com/jquery-latest.js"></script> 
</head> 


<body> 
    <div id="content"> 
     <div id="hidebar"> 
      <div id="jqb1"></div> 
      <div id="jqb2"></div> 
      <div id="jqb3"></div> 
      <div id="jqb4"></div>  
     </div>  
     <div id="content-inner"> 
     <a href="index.html"> 
       <img src="images/logo.jpg"/ alt> 
      </a> 

     </div> 

    </div> 
    <div id="colour-bar"></div> 
    <div id="navbar"> 
     <div id="navbar-inner"> 
      <ul> 
       <li><a href="#" rel="1"><button1>About us</button1></a></li> 
       <li><a href="#" rel="2"><button2>Partners</button2></a></li> 
       <li><a href="#" rel="3"><button3>Solutions</button3></a></li> 
       <li><a href="#" rel="4"><button4>Services</button4></a></li> 
      </ul> 
     </div> 
    </div> 
    <div id="footer"> 
     <div id="footer-inner"> 
      <div id="footer-small"></div> 
       <div id="footer-large"> 
        <div class="table"> 
         <div class="tr"> 
          <div class="td"> 
           <h3>Contact Us:</h3> 
          </div> 
          <div class="td"> 
          </div> 
         </div> 
         <div class="tr"> 
          <div class="td"> 
           <h4>AUS - Melbourne<br /> 
           101 Main Street<br /> 
           Glen Iris VIC 3146</h4> 
          </div> 
          <div class="td"> 
           <h4>Email: [email protected]<br /> 
           Phone: (03) 9888 8888<br /> 
           Fax: (03) 9888 8888</h4> 
          </div> 
         </div> 
        </div> 
       </div> 
      <div id="footer-small"></div> 
     </div> 
    </div> 

<script> 
$("button1").click(function() { 
$("#hidebar").fadeIn("slow"); 
$("button1").toggle(); 
$("button2").show(); 
$("button3").show(); 
$("button4").show(); 
$("#jqb1").show(); 
$("#jqb2").hide(); 
$("#jqb3").hide(); 
$("#jqb4").hide(); 
}); 

$("button2").click(function() { 
$("#hidebar").fadeIn("slow"); 
$("button2").toggle(); 
$("button1").show(); 
$("button3").show(); 
$("button4").show(); 
$("#jqb2").show(); 
$("#jqb1").hide(); 
$("#jqb3").hide(); 
$("#jqb4").hide(); 
}); 

$("button3").click(function() { 
$("#hidebar").fadeIn("slow"); 
$("button3").toggle(); 
$("button1").show(); 
$("button2").show(); 
$("button4").show(); 
$("#jqb3").show(); 
$("#jqb1").hide(); 
$("#jqb2").hide(); 
$("#jqb4").hide(); 
}); 

$("button4").click(function() { 
$("#hidebar").fadeIn("slow"); 
$("button4").toggle(); 
$("button1").show(); 
$("button2").show(); 
$("button3").show(); 
$("#jqb4").show(); 
$("#jqb1").hide(); 
$("#jqb2").hide(); 
$("#jqb3").hide(); 
}); 
</script> 

</body> 
</html> 
+0

일부 버전의 문제 ... – Chad

+0

흠이 발생할 수 불투명도를 지원하지 않습니다. 감사합니다 @ 차드. 주위에 작품을 추천 해 주시겠습니까? – Dan

답변

0

나는 당신이 직면하고있는 문제는 IE는 <button1>

같은 사용자 지정 요소를 이해하지과 관련이있다 생각

나는 ID를 가진 표준 <button> 요소로 변경 :

$("#button1").click(function() { 
    ... 
}); 

$("#button2").click(function() { 
    ... 
}); 

$("#button3").click(function() { 
    ... 
}); 

$("#button4").click(function() { 
    ... 
}); 

가 나는에 코드를 이동 :

<button id="button1">About us</button> 
<button id="button2">Partners</button> 
<button id="button3">Solutions</button> 
<button id="button4">Services</button> 

가 차례로, 나는 또한 그에 따라 요소 ID의 발동 버튼 핸들러를 변경 바이올린은 IE7-IE9 문서 모드로 IE10에서 테스트했습니다. 초기 fadeIn 트리거가 발생하지 않는 문제가 해결 된 것으로 보입니다. IE의

jsfiddle

+0

나는 당신을 사랑한다고 생각한다 @ 루벤 인판트! 당신은 전설이며, 방금 코드를 구현했으며 버튼의 스타일을 삭제했습니다. D You Champ – Dan

+0

도움이 되니 기쁩니다. 문제가 해결되면 답변을 수락 하시겠습니까? –

+0

Oopsies! 나는 내가 가지고 있다고 생각했다 :) – Dan

관련 문제