簡體   English   中英

圖像和進度欄未在Internet Explorer中加載,但在Firefox,Chrome等中加載

[英]Image & progress bar not loading in internet explorer, but loads in firefox, chrome etc

我正在使用最新的IE,Firefox和chrome。 當我在本地服務器甚至主服務器上運行php代碼時。 內容滑塊和進度欄中的圖像不會單獨在Internet Explorer中加載。 它顯示為黑色圖像。 以下是我的內容滑塊及其CSS的代碼。

我到處都在尋找解決方案,但似乎在我的代碼中找不到問題。 我什至檢查過我的jpg圖像是否為RGB格式,這是某些人以前遇到的。

</div>
<!--slider for news-->
<div class="container">
<div id="content-slider">
<div id="slider">
    <div id="mask">
    <ul>
    <li id="first" class="firstanimation">
    <a href="#">
    <img src="login/images/images1.jpg" alt="news1"/>
    </a>
    </li>

    <li id="second" class="secondanimation">
    <a href="#">
    <img src="login/images/images2.jpg" alt="news2"/>
    </a>
    </li>

    <li id="third" class="thirdanimation">
    <a href="#">
    <img src="login/images/images3.jpg" alt="news3"/>
    </a>
    </li>

    <li id="fourth" class="fourthanimation">
    <a href="#">
    <img src="login/images/images4.jpg" alt="news4"/>
    </a>
    </li>

    <li id="fifth" class="fifthanimation">
    <a href="#">
    <img src="login/images/images5.jpg" alt="news5"/>
    </a>
    </li>
    </ul>
    </div>
    <div class="progress-bar"></div>
    </div>
</div>

上面的css如下所示。

/* LAYOUT */
.container {
margin:0 auto;
overflow:hidden;
width:960px;
}

/* CONTENT SLIDER */
#content-slider {
width:auto;
height:220px; /* 360px*/
margin:10px auto 0;
}
/* SLIDER */
#slider {
background:#000;
border:5px solid #eaeaea;
box-shadow:1px 1px 5px rgba(0,0,0,0.7);
height:193px;
width:155px;
margin:40px auto 0;
overflow:visible;
position:absolute;
top:150px;
left:800px;
float:right;
}
#mask {
overflow:hidden;
height:320px;
}
#slider ul {
margin:0;
padding:0;
position:relative;
}
#slider li {
width:680px;
height:320px;
position:absolute;
top:-325px;
list-style:none;
} 

#slider li.firstanimation {
-moz-animation:cycle 25s linear infinite;   
-webkit-animation:cycle 25s linear infinite;        
}
#slider li.secondanimation {
-moz-animation:cycletwo 25s linear infinite;
-webkit-animation:cycletwo 25s linear infinite;     
}
#slider li.thirdanimation {
-moz-animation:cyclethree 25s linear infinite;
-webkit-animation:cyclethree 25s linear infinite;       
}
#slider li.fourthanimation {
-moz-animation:cyclefour 25s linear infinite;
-webkit-animation:cyclefour 25s linear infinite;        
}
#slider li.fifthanimation {
-moz-animation:cyclefive 25s linear infinite;
-webkit-animation:cyclefive 25s linear infinite;        
}
#slider:hover li, 
#slider:hover .progress-bar {
-moz-animation-play-state:paused;
-webkit-animation-play-state:paused;
}

/* PROGRESS BAR */
.progress-bar { 
position:relative;
top:-5px;
width:680px; 
height:5px;
background:#000;
-moz-animation:fullexpand 25s ease-out infinite;
-webkit-animation:fullexpand 25s ease-out infinite;
}

您尚未提及用於動畫的關鍵幀。 而且,您只為兩個瀏覽器編寫了動畫屬性。

#slider li.firstanimation {
   -moz-animation:cycle 25s linear infinite;   /* This is Firefox prefix*/
   -webkit-animation:cycle 25s linear infinite;  /* This is Chrome/Opera prefix*/
}

IE無法理解以上前綴,因此添加

#slider li.firstanimation {
   -moz-animation:cycle 25s linear infinite;   /* This is Firefox prefix*/
   -webkit-animation:cycle 25s linear infinite;  /* This is Chrome/Opera prefix*/
   animation:cycle 25s linear infinite; /* for IE */
}

現在,我可以假設的是,由於前綴問題而沒有發生動畫,並且沒有顯示圖像。 請使用更多詳細信息更新您的問題,並添加小提琴。

另外添加了以下內容,然后它才有效

animation: fullexpand 10s ease-out infinite;  
@keyframes fullexpand {
    0% {
        width: 0px;}
    100% {
        width: 100%;};
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM