我正在使用最新的 IE、Firefox 和 chrome。当我在我的本地服务器甚至我的主服务器上运行我的 php 代码时。内容 slider 和进度条中的图像不会单独在 Internet Explorer 中加载。它显示为黑色图像。下面是我的内容 slider 及其 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 */
}
现在我可以假设的是,由于前缀问题,动画没有发生,你的图像没有显示。请使用更多详细信息更新您的问题并添加 fiddle 。
关于php - 图像和进度条未在 Internet Explorer 中加载,但在 Firefox、Chrome 等中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23378853/