Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript CSS3或HTML5-如何制作背景动画,如HTML5页面中漂浮的云?_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript CSS3或HTML5-如何制作背景动画,如HTML5页面中漂浮的云?

Javascript CSS3或HTML5-如何制作背景动画,如HTML5页面中漂浮的云?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我只是想知道是否有一种方法可以在纯基于CSS3的设计中使用一点HTML5或jquery来制作背景动画 我可以看到一些人这样做 在CSS3中有没有简单的方法可以做到这一点? CSS @keyframes animatedBackground { from { background-position: 0 0; } to { background-position: 100% 0; } } @-webkit-keyframes ani

我只是想知道是否有一种方法可以在纯基于CSS3的设计中使用一点HTML5或jquery来制作背景动画

我可以看到一些人这样做

在CSS3中有没有简单的方法可以做到这一点?

CSS

@keyframes animatedBackground {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100% 0;
    }
}
@-webkit-keyframes animatedBackground {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100% 0;
    }
}
@-ms-keyframes animatedBackground {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100% 0;
    }
}
@-moz-keyframes animatedBackground {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 100% 0;
    }
}
#wrap {
    height:100%;
    width:100%;
    background: url(http://addtwitter-followers.com/wp-content/themes/twentyten/images/bck.jpg) top no-repeat #94E3F4;
    background-position: 0px 0px;
    background-repeat: repeat-x;
    animation: animatedBackground 150s linear infinite;
    -ms-animation: animatedBackground 150s linear infinite;
    -moz-animation: animatedBackground 150s linear infinite;
    -webkit-animation: animatedBackground 150s linear infinite;
}
HTML

<div id="wrap">...</div>
。。。

参考资料