微信小程序滚动消息通知实现代码

互联网 18-2-3
我们走在大街上,会经常看到许多店家门上有滚动的消息通知,本文主要为大家详细介绍了微信小程序实现滚动消息通知,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,希望能帮助到大家。

效果图:

index.wxml

<!--index.wxml-->  <swiper class="swiper_container" vertical="true" autoplay="true" circular="true" interval="1000">   <block wx:for="{{msgList}}">   <navigator url="/pages/index/index?title={{item.url}}" open-type="navigate">    <swiper-item>    <view class="swiper_item">{{item.title}}</view>    </swiper-item>   </navigator>   </block>  </swiper>

index.js

//index.js  //获取应用实例  var app = getApp()  Page({   data: {   },   onLoad(e) {   console.log(e.title)   this.setData({    msgList: [    { url: "url", title: "多地首套房贷利率上浮 热点城市渐迎零折扣时代" },    { url: "url", title: "交了20多年的国内漫游费将取消 你能省多少话费?" },    { url: "url", title: "北大教工合唱团出国演出遇尴尬:被要求给他人伴唱" }]   });   }  })
/**index.wxss**/    .swiper_container {   background-color: red;   height: 50rpx;   width: 80vw;  }    .swiper_item {   font-size: 30rpx;   overflow: hidden;   text-overflow: ellipsis;   white-space: nowrap;  }

滚动消息通知小程序的实例代码展示

以上就是微信小程序滚动消息通知实现代码的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
标签: 通知
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:文字跑马灯效果的实现

相关资讯