2016-09-29 13 views
0

30の背景をアニメーション化する作業方法を見つけようとしています。
CSSはIE & Firefoxで動作していなかったので、jqueryを試してみました。この2つのブラウザで「点滅」しています。
私はcss:bodyを使って画像をプリロードしています:after {display:none;コンテンツ:URLのURL URLなど}jquery FirefoxとIEで複数の背景アニメーションが点滅するように見える

$(function() { 
    setInterval("anim1()", 100); 
}); 

function anim1() { 
    var oCurBack = $('#fullback div.current'); 
    var oNxtBack = oCurBack.next(); 
    if (oNxtBack.length == 0) 
     return; 

    oNxtBack.addClass('current'); 
    oCurBack.removeClass('current').addClass('previous'); 
} 

CSS:

#fullback div { 
    z-index: 0; 
} 

#fullback div.current{ 
    position: fixed; 
    z-index: 2; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-position: center; 
    background-size: cover; 
    background-repeat: no-repeat; 
} 

#fullback div.previous{ 
    z-index: 1; 
} 

私はそれはIE &のFirefoxの "点滅効果" なしで動作させることができる方法を私に示してください。

答えて

0

それはまだFirefoxの上で少し点滅しても、私はCSSで間違っていた:

#fullback div { 
    z-index: 0; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-position: center; 
    background-size: cover; 
    background-repeat: no-repeat; 
} 

#fullback div.current{ 
    z-index: 2; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-position: center; 
    background-size: cover; 
    background-repeat: no-repeat; 
} 

#fullback div.previous{ 
    z-index: 1; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-position: center; 
    background-size: cover; 
    background-repeat: no-repeat; 
}