Skip to content

Commit

Permalink
docs(index): modified event listener usage in index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbobell committed Jun 28, 2017
1 parent fdf2fe4 commit 933bbe7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,34 @@
}

var swiper = new Swiper({
debug: true,
// debug: true,
data: list,
container: document.querySelector('.outer-container'),
// isVertical: false,
isLoop: true,
isLoop: false,
// initIndex: 0,
// 设定从该页面出去的效果
transition: {
name: 'slide',
// duration: 400,
// direction: 1
},

onSwipeStart: function () {
console.log('onSwipeStart');
},
onSwipeChange: function () {
console.log('onSwipeChange');
},
onSwipeChanged: function () {
console.log('onSwipeChanged')
}
});

var events = [
'swipeBeforeStart',
'swipeStart',
'swipeChange',
'swipeChanged',
'swipeRestore',
'swipeRestored',
'activePageChanged',
'destroy'
];

swiper.on(events.join(' '), function (e) {
console.log(e.name);
})

// swiper.on('swipeChange', function () {
// console.log('swipeChange');
Expand Down

0 comments on commit 933bbe7

Please sign in to comment.