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);
I'm trying to pass var pageBefore
to the function from onSwipeEnd
but its empty there. What can I do to pass the variable pageBefore inside the onSwipeEnd
function?