propagating-hammerjs icon indicating copy to clipboard operation
propagating-hammerjs copied to clipboard

panmove is not work when swipe first time in device of android

Open Krishna25Vrinsoft opened this issue 7 years ago • 1 comments

I am facing issue with "panmove". when i swipe bottom to top and top to bottom its not work first time. I have used Hammerjs with backbonejs hybrid mobile app. I have make a bottom penal when it swipe we do some more option. but its not work properly. when i swipe second time it work fine. at first time i am not getting panmove event same thing i am getting in ios device.

this.$el.html("#div")
this.$el.hammer();
this.$el.data('hammer').get('pan').set({ threshold: 5 });
this.initHeight = -(this.$el.outerHeight() - this.$('.swiper-container').outerHeight());
this.estimateTopPosition = this.$el.position().top;

//This function call on panup, pandown, panstart, panmove, panend, pancancel, panright, panleft, tap, press event
fareContainerSwipe: function (e) {
	var swipeType = e.type;
	var speed = 500;
	console.log(e.type + ', ' + e.gesture.offsetDirection + ', ' + e.gesture.direction + ', ' + e.gesture.distance + ', deltaY: ' + e.gesture.deltaY);
	var distance = e.gesture.distance;
	var nav = this.$el;
	var transInitHeight = this.transInitHeight;
	var currentPosition = this.$el.position();
	
	
	var mDistance;

	if (swipeType == 'panmove' && (e.gesture.direction == 16)) { //Pan down

	}else if (swipeType == 'panmove' && e.gesture.direction == 8) {    //Pan up

	}
} 

Krishna25Vrinsoft avatar Jun 20 '17 12:06 Krishna25Vrinsoft

Can you create a jsbin or jsfiddle to demonstrate the issue? It's hard to guess what's going on exactly from the code snippet that you posted.

josdejong avatar Jun 23 '17 07:06 josdejong