jQuery+CSS3小鸟飞翔动画

2025-11-04 09:20:50

1、准备好需要用到的图标。

jQuery+CSS3小鸟飞翔动画

jQuery+CSS3小鸟飞翔动画

2、新建html文档。

jQuery+CSS3小鸟飞翔动画

3、<div class="box">

  <div></div>

</div>

jQuery+CSS3小鸟飞翔动画

4、书写css代码。

<style>

* { margin: 0; padding: 0; }

.box { width: 564px; height: 170px; }

.box div { width: 141px; height: 85px; float: left; margin-top: 150px; margin-left: 50px; background: url(images/bird1.png);/* 用于Firefox 可无视 */ --: myFrist 1s linear infinite; -moz-: myFrist 1s linear infinite; -o-: myFrist 1s linear infinite; : myFrist 1s linear infinite; }

@--keyframes myFrist {  0% {

background:url(images/bird1.png);

background-size: 100% 100%

}

 12.5% {

background:url(images/bird2.png);

background-size: 100% 100%

}

 25% {

background:url(images/bird3.png);

background-size: 100% 100%

}

 37.5% {

background:url(images/bird4.png);

background-size: 100% 100%

}

 50% {

background:url(images/bird5.png);

background-size: 100% 100%

}

 65.7% {

background:url(images/bird6.png);

background-size: 100% 100%

}

 75% {

background:url(images/bird7.png);

background-size: 100% 100%

}

 87.5% {

background:url(images/bird8.png);

background-size: 100% 100%

}

 100% {

background:url(images/bird1.png);

background-size: 100% 100%

}

}

@-moz-keyframes myFrist {  0% {

background:url(images/bird1.png);

background-size: 100% 100%

}

 12.5% {

background:url(images/bird2.png);

background-size: 100% 100%

}

 25% {

background:url(images/bird3.png);

background-size: 100% 100%

}

 37.5% {

background:url(images/bird4.png);

background-size: 100% 100%

}

 50% {

background:url(images/bird5.png);

background-size: 100% 100%

}

 65.7% {

background:url(images/bird6.png);

background-size: 100% 100%

}

 75% {

background:url(images/bird7.png);

background-size: 100% 100%

}

 87.5% {

background:url(images/bird8.png);

background-size: 100% 100%

}

 100% {

background:url(images/bird1.png);

background-size: 100% 100%

}

}

@-o-keyframes myFrist {  0% {

background:url(images/bird1.png);

background-size: 100% 100%

}

 12.5% {

background:url(images/bird2.png);

background-size: 100% 100%

}

 25% {

background:url(images/bird3.png);

background-size: 100% 100%

}

 37.5% {

background:url(images/bird4.png);

background-size: 100% 100%

}

 50% {

background:url(images/bird5.png);

background-size: 100% 100%

}

 65.7% {

background:url(images/bird6.png);

background-size: 100% 100%

}

 75% {

background:url(images/bird7.png);

background-size: 100% 100%

}

 87.5% {

background:url(images/bird8.png);

background-size: 100% 100%

}

 100% {

background:url(images/bird1.png);

background-size: 100% 100%

}

}

@keyframes myFrist {  0% {

background:url(images/bird1.png);

background-size: 100% 100%

}

 12.5% {

background:url(images/bird2.png);

background-size: 100% 100%

}

 25% {

background:url(images/bird3.png);

background-size: 100% 100%

}

 37.5% {

background:url(images/bird4.png);

background-size: 100% 100%

}

 50% {

background:url(images/bird5.png);

background-size: 100% 100%

}

 65.7% {

background:url(images/bird6.png);

background-size: 100% 100%

}

 75% {

background:url(images/bird7.png);

background-size: 100% 100%

}

 87.5% {

background:url(images/bird8.png);

background-size: 100% 100%

}

 100% {

background:url(images/bird1.png);

background-size: 100% 100%

}

}

</style>

jQuery+CSS3小鸟飞翔动画

5、代码整体结构。

jQuery+CSS3小鸟飞翔动画

6、查看效果。

jQuery+CSS3小鸟飞翔动画

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:103
  • 阅读量:157
  • 阅读量:67
  • 阅读量:114
  • 阅读量:43
  • 猜你喜欢