欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序實現滾動消息通知

 更新時間:2018年02月02日 10:38:23   作者:xiaochun365  
這篇文章主要為大家詳細介紹了微信小程序實現滾動消息通知,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了微信小程序實現滾動消息的具體代碼,供大家參考,具體內容如下

效果圖:

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

/**index.wxss**/

.swiper_container {
 background-color: red;
 height: 50rpx;
 width: 80vw;
}

.swiper_item {
 font-size: 30rpx;
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論