波浪效果实现

HTML
注意:bolang.png这张图片在设计的时候,头尾要能连接起来(就是要对称,效果会比较好)。

<!--波浪效果-->
<div class="waveEffect">
	<div class="waveContent"></div>
	<div class="wavePic">
		<div class="waveImg"></div>
	</div>
</div>

SCSS

.waveEffect{
        width:100%;
        overflow:hidden;

        .waveContent{
            width:100%;
            position:relative;
            z-index:1;
            height:940px;
            margin:0 auto;
            //padding-top:100px;
        }
        .wavePic{
            position: relative;
            z-index: 3;
            width: 100%;
            color: #999;
            margin-top: -140px;
            background: url(../../../assets/img/cms/bolang.png) repeat-x 0 0;
            -webkit-animation: 8s linear 0s none infinite wavePicRoll;
            -moz-animation: 8s linear 0s none infinite wavePicRoll;
            animation: 8s linear 0s none infinite wavePicRoll;
        }
        .waveImg{
            height: 200px;
            background: url(../../../assets/img/cms/bolang.png) repeat-x 330px 0;
            -webkit-animation: 10s linear 0s none infinite waveImgRoll;
            -moz-animation: 10s linear 0s none infinite waveImgRoll;
            animation: 10s linear 0s none infinite waveImgRoll;
        }

        @-webkit-keyframes wavePicRoll{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1920px 0;
            }
        }
        @-moz-keyframes wavePicRoll{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1920px 0;
            }
        }
        @keyframes wavePicRoll{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: -1920px 0;
            }
        }

        @-webkit-keyframes waveImgRoll{
            0%{
                background-position: 0 0;
            }
            100%{
                background-position: 1920px 0;
            }
        }
        @-moz-keyframes waveImgRoll{
            0%{
                background-position:0 0;
            }
            100%{
                background-position: 1920px 0;
            }
        }
        @keyframes waveImgRoll{
            0%{
                background-position:0 0;
            }
            100%{
                background-position: 1920px 0;
            }
        }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值