首页 > 其他 > 详细

animate 的使用 背景图由大变小

时间:2019-10-21 15:40:23      阅读:98      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css3 animation动画停留在最后一帧</title>
<meta name="viewport" content="width=width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<style type="text/css">

  body{margin: 0;}
  .over{
     width: 1920px;
     height: 587px; 
	 overflow:hidden; //先将溢出的隐藏
	 position: relative;
	 z-index: 1
    }
	
	.m-test{
	height: 587px; 
    animation:moveBackground 6s;  //设置动画的时间
    background:url("") center center;//可以定义一个背景图
    animation-fill-mode: forwards;   //设置动画在最后一帧停止
    }

    @-webkit-keyframes moveBackground {
      0% { transform: scale(1.1, 1.1);}
      100% { transform: scale(1, 1);}
    }
    @keyframes moveBackground {
      0% { transform: scale(1.1, 1.1);}
      100% { transform: scale(1, 1);}
    }  
</style>
</head>
<body>
<div class="over">
<div class="m-test"></div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script type="text/javascript">
</script>
</body>

</html>

  

animate 的使用 背景图由大变小

原文:https://www.cnblogs.com/whl4835349/p/11713237.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!