【问题标题】:Image & progress bar not loading in internet explorer, but loads in firefox, chrome etc图像和进度条未在 Internet Explorer 中加载,但在 firefox、chrome 等中加载
【发布时间】:2014-06-16 05:29:18
【问题描述】:

我正在使用最新的 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;
}

【问题讨论】:

  • 在将其标记为重复之前,请阅读我的问题,该问题指出我正在使用最新的 Internet Explorer。作为 IE 10 或以下版本的答案。我正在使用 IE 11。

标签: php html css internet-explorer


【解决方案1】:

您没有提到用于动画的关键帧。而且你只为两个浏览器编写了动画属性。

#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 */
}

现在我可以在这里假设动画由于前缀问题而没有发生,并且您的图像没有被显示。请用更多细节更新您的问题并添加小提琴。

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-11
      • 1970-01-01
      • 2020-03-02
      • 1970-01-01
      • 1970-01-01
      • 2021-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多