(●'◡'●)ノ
 
收藏文章 楼主

微信小程序css简单公告跑马灯,不用js完整代码

版块:经验教程   类型:普通   作者:小狼人   查看:2161   回复:0   获赞:2   时间:2020-08-12 16:43:10

效果图

Image

wxss

/*首页跑马灯效果*/
@keyframes around {
  from {
   margin-left: 100%;
  }
  to {
   /* var接受传入的变量 */
   margin-left: var(--marqueeWidth--);
  }
 }
 
.marquee_container{
  background-color: #fff;
  height: 50rpx;
  line-height: 44rpx;
  position: relative;
  width: 100%;
  margin-top:0rpx;
}
.marquee_container:hover{
  /* 不起作用 */
  animation-play-state: paused;
}
.marquee_text{
  color:#737373;
  font-size: 28rpx;
  display: inline-block;
  white-space: nowrap;
  animation-name: around;
  animation-duration: 10s;  /*过渡时间*/
  animation-iteration-count: infinite;
  animation-timing-function:linear;
}
wxml

		<!-- 公告 -->
<view class="marquee_container" style="--marqueeWidth--:-12em">
    <view class="marquee_text">欢迎使用爱宅域影视小程序,祝您观看愉快。</view>
</view>
<!--跑马灯-->

缺点,内容过长无法显示完整


来源:scdn

赢得客户的认可,需要服务细节化 
回复列表
默认   热门   正序   倒序

回复:微信小程序css简单公告跑马灯,不用js完整代码

Powered by HadSky 8.5.2

©2015 - 2025 爱宅域

加入官群 QQ咨询 友链展示 申请友链

您的IP:216.73.216.222,2025-07-02 02:40:11,Processed in 0.27599 second(s).

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息
已有0次打赏
(2) 分享
分享

请保存二维码或复制链接进行分享

取消