公告

  <!-- 公告 -->
  <view class='notice-wrap' hidden='{{hideNotice}}'>
  <view class='notice ovh font28 relative'>
    <view class="marquee_text" style="left:{{marqueeDistance}}px;">
        <text decode="{{true}}">{{notice}}</text>
    </view>
  </view>
  </view>

/* 公告 */
.notice-wrap{background:#ff6633;padding:10rpx 70rpx 10rpx 0;height:50rpx; margin-top: 10rpx;}
.ovh{overflow:hidden}
.font28{font-size:28rpx}
.relative{position:relative}
.notice{color:#fff;width:100%;height:40rpx;}
.marquee_text {
  white-space: nowrap;
  position: absolute;
  top: 0;
}
.close-icon{position:absolute;right:15rpx;top:114rpx;}
.icon40{width:40rpx;height:40rpx;}   
.right{float:right}
.icon{display:inline-block;width:32rpx;height:32rpx;background-size:contain;}
/**
     * 公告
     */
    run1: function () {
        var that = this;
        that.data.countTime = setInterval(function () {
            if (-that.data.marqueeDistance < that.data.length) {
                that.setData({
                    marqueeDistance: that.data.marqueeDistance - that.data.marqueePace,
                });
            } else {
                clearInterval(that.data.countTime);
                that.setData({
                    marqueeDistance: that.data.windowWidth
                });
                that.run1();
            }
        }, that.data.interval);
    },

 

发布了297 篇原创文章 · 获赞 7 · 访问量 1万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 技术黑板 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览