ColorUI 源代码
This commit is contained in:
weilanwl
2018-06-19 21:21:54 +08:00
parent 9e6720d0dc
commit 3834693e84
114 changed files with 4477 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
// pages/document/slider/slider.js
Page({
data: {
scrollInto: 0,
scrollList: [
{ id: '1' },
{ id: '2' },
{ id: '3' },
{ id: '1' },
{ id: '2' },
{ id: '3' },
{ id: '4' },
{ id: '1' },
{ id: '2' }]
},
scrollLeft: function (e) {
var into = this.data.scrollInto;
var length = this.data.scrollList.length;
if (into > 0) {
this.setData({
scrollInto: into - 1,
})
} else {
this.setData({
scrollInto: length - 3,
})
}
},
scrollRight: function (e) {
var into = this.data.scrollInto;
if (into < this.data.scrollList.length - 3) {
this.setData({
scrollInto: into + 1,
})
} else {
this.setData({
scrollInto: 0,
})
}
},
})