CSS 滚动动画在 Edge 中不起作用

标签 css animated microsoft-edge

我正在使用动画在我正在编码的新网站上滚动一些图像,但我刚刚发现它在 Edge 上不起作用?

这是我的代码,有人知道为什么它不起作用吗?看起来很奇怪,Edge 不能作为最新版本运行:)

HTML

<div class="photobanner">
    <a href="" class="first"><img src="images/debeer-refinish-logo-landscape.svg" width="150" height="47" alt="De-Beer Refinish" style="margin-top:16px;" /></a>
    <a href=""><img src="images/dna-custom-paints-logo.svg" width="150" height="63" alt="Custom Paints" style="margin-top:8px;" /></a>
    <a href=""><img src="images/earthsense-logo.svg" width="150" height="55" alt="EarthSense by Valspar" style="margin-top:12px;" /></a>
    <a href=""><img src="images/sayerlack-logo-portrait.svg" width="150" height="60" alt="Sayerlack" style="margin-top:10px;" /></a>
    <a href=""><img src="images/spralac-logo.svg" width="150" height="62" alt="Spralac" style="margin-top:9px;" /></a>
    <a href=""><img src="images/vim-logo.svg" width="114" height="70" alt="Valspar Industrial Mix" style="margin-top:5px;" /></a>
    <a href=""><img src="images/valspar-refinish-logo.svg" width="150" height="50" alt="Valspar Industrial Mix" style="margin-top:15px;" /></a>
    <a href=""><img src="images/debeer-refinish-logo-landscape.svg" width="150" height="47" alt="De-Beer Refinish" style="margin-top:16px;" /></a>
    <a href=""><img src="images/dna-custom-paints-logo.svg" width="150" height="63" alt="Custom Paints" style="margin-top:8px;" /></a>
    <a href=""><img src="images/earthsense-logo.svg" width="150" height="55" alt="EarthSense by Valspar" style="margin-top:12px;" /></a>
    <a href=""><img src="images/sayerlack-logo-portrait.svg" width="150" height="60" alt="Sayerlack" style="margin-top:10px;" /></a>
    <a href=""><img src="images/spralac-logo.svg" width="150" height="62" alt="Spralac" style="margin-top:9px;" /></a>
    <a href=""><img src="images/vim-logo.svg" width="114" height="70" alt="Valspar Industrial Mix" style="margin-top:5px;" /></a>
</div>

(S)CSS

.photobanner {
overflow: hidden;
height: 80px;
width: 1260px;
padding-bottom: 5px;
a {
    display: inline-block;
    width: 160px;
    height: 80px;
    margin: 0 10px;
    background-color: #F9F9F9;
    //background-color: #000000;
    text-align: center;
    overflow: auto;
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
    -ms-transition: all 0.5s ease;
    transition: all 0.5s ease;
    &:hover {
        -webkit-transform: scale(1.1);
        -moz-transform: scale(1.1);
        -o-transform: scale(1.1);
        -ms-transform: scale(1.1);
        transform: scale(1.1);
        -webkit-box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
        -moz-box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
        box-shadow: 0px 3px 5px rgba(0,0,0,0.2);
    }
}
/*keyframe animations*/
.first {
    -webkit-animation: bannermove $banner-speed linear infinite;
    -moz-animation: bannermove $banner-speed linear infinite;
    -ms-animation: bannermove $banner-speed linear infinite;
    -o-animation: bannermove $banner-speed linear infinite;
    animation: bannermove $banner-speed linear infinite;
}
@keyframes "bannermove" {
    0% {margin-left: 0px;}
    100% {margin-left: $banner-100;}
}
@-moz-keyframes bannermove {
    0% {margin-left: 0px;}
    100% {margin-left: $banner-100;}
}
@-webkit-keyframes "bannermove" {
    0% {margin-left: 0px;}
    100% {margin-left: $banner-100;}
}
@-ms-keyframes "bannermove" {
    0% {margin-left: 0px;}
    100% {margin-left: $banner-100;}
}
@-o-keyframes "bannermove" {
    0% {margin-left: 0px;}
    100% {margin-left: $banner-100;}
}
}

可以在 http://www.dbnz.co.nz/2016-preview/ 预览该网站

提前干杯

最佳答案

动画确实可以在 Edge 中使用,但您需要对代码进行一些更改。我遵循位于 here 的 W3C 标准Microsoft Edge 完全支持。我可以通过一些小的更改让横幅动画化。同样,这不是完整的代码,而是朝着正确方向迈出的一步,以便您可以解决您的问题。

希望这有帮助!

CSS

.photobanner {
    overflow: hidden;
    height: 80px;
    width: 1260px;
    padding-bottom: 5px; 
    position: relative;
}
.photoSlider {
    position: absolute;
    width: 1260px;
    height: 80px;
    left: 0;
    top: 0;
    animation-name: horizontal-slide;
    animation-duration: 30s;
    animation-iteration-count: infinite;    
    animation-timing-function: linear;  
}           
@keyframes horizontal-slide {
    from {
        left: 0;
        top: 0;
    }
    to {
        left: -1200px;
    }
}   

HTML

<div class="photobanner">
    <div class="photoSlider">
        <a href="" class="first"><img src="images/debeer-refinish-logo-landscape.svg" width="150" height="47" alt="De-Beer Refinish" style="margin-top:16px;" /></a>
        <a href=""><img src="images/dna-custom-paints-logo.svg" width="150" height="63" alt="Custom Paints" style="margin-top:8px;" /></a>
        <a href=""><img src="images/earthsense-logo.svg" width="150" height="55" alt="EarthSense by Valspar" style="margin-top:12px;" /></a>
        <a href=""><img src="images/sayerlack-logo-portrait.svg" width="150" height="60" alt="Sayerlack" style="margin-top:10px;" /></a>
        <a href=""><img src="images/spralac-logo.svg" width="150" height="62" alt="Spralac" style="margin-top:9px;" /></a>
        <a href=""><img src="images/vim-logo.svg" width="114" height="70" alt="Valspar Industrial Mix" style="margin-top:5px;" /></a>
        <a href=""><img src="images/valspar-refinish-logo.svg" width="150" height="50" alt="Valspar Industrial Mix" style="margin-top:15px;" /></a>
        <a href=""><img src="images/debeer-refinish-logo-landscape.svg" width="150" height="47" alt="De-Beer Refinish" style="margin-top:16px;" /></a>
        <a href=""><img src="images/dna-custom-paints-logo.svg" width="150" height="63" alt="Custom Paints" style="margin-top:8px;" /></a>
        <a href=""><img src="images/earthsense-logo.svg" width="150" height="55" alt="EarthSense by Valspar" style="margin-top:12px;" /></a>
        <a href=""><img src="images/sayerlack-logo-portrait.svg" width="150" height="60" alt="Sayerlack" style="margin-top:10px;" /></a>
        <a href=""><img src="images/spralac-logo.svg" width="150" height="62" alt="Spralac" style="margin-top:9px;" /></a>
        <a href=""><img src="images/vim-logo.svg" width="114" height="70" alt="Valspar Industrial Mix" style="margin-top:5px;" /></a>
    </div>
</div>

关于CSS 滚动动画在 Edge 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33400258/

相关文章:

xcode - 在 swift 中循环零填充数字 - Xcode

javascript - Javascript 中的动画线图?

animation - 无法将 React Native Animated 值设置为 View 组件 CSS 样式

Javascript 指针事件 - Wacom Pen Pressure 和 Tilt 未注册

php - CSS 未加载到移动版 Safari

jquery - 根据容器子节点的数量计算 <article> 的高度()

css - 为什么样式面板只显示 css 文件而不显示 .scss 文件?

css - 删除 Stack Exchange 链接的下划线样式而不闪烁

gulp - 使用 Microsoft Edge 设置 Protractor

css - 全高左右边框,无底边框