var pageBefore;
$("#demo").dragend({
onSwipeStart: function() { var pageBefore = this.page; console.log(pageBefore); },
jumpToPage: 2,
onSwipeEnd: function() {
var pageNow = this.page;
console.log(pageBefore);
console.log(pageNow);
我正在尝试将var pageBefore
传递给来自onSwipeEnd
的函数,但它在那里是空的。如何在onSwipeEnd
函数中传递变量pageBefore?