var el = document.getElementById('scroll');
var twoNext = 0
this.swipedetect(el, function(swipedir){
if (!isNaN(swipedir)) {
twoNext = swipedir
console.log(twoNext) // значение присвоилось
}
})
console.log(twoNext)// значение undefuned
Asked
Active
Viewed 34 times
0
swipedetectпопробуйте использовать анонимную функцию – webDev_ Jan 20 '18 at 08:59