小程序实现跑马灯效果组件

小程序实现跑马灯效果组件
wxml:

 
      
        {{homedata.post[0].post_title}}
        
        {{homedata.post[0].post_title}}
        
        {{homedata.post[0].post_title}}
        
      
    

wxss:

@keyframes kf-marque-animation{ 0% { transform: translateX(0); } 100% { transform: translateX(-33.3%); } }
.marquee{
    width: 100%;
    height: 60rpx;
    line-height: 60rpx;
    background: #fff;
    border: none;
    display: block;
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
    position: relative;
    font-size: 28rpx;
}
.marquee .content{
    display: inline-block;
    position: relative;
    padding-right: 0px;
    animation: kf-marque-animation 11.3s linear infinite;
    white-space: nowrap;
}

你可能感兴趣的:(小程序实现跑马灯效果组件)