jquery.finger icon indicating copy to clipboard operation
jquery.finger copied to clipboard

Prevent default but not vertical scrolling.

Open senner007 opened this issue 12 years ago • 9 comments

Whats the status on this?

I found a solution using hammer.js :

$('#container').hammer({drag_block_horizontal: true});

,but then I have to include this library for this funtionality only.

senner007 avatar Jul 24 '13 03:07 senner007

Hi,

I will refactor all prevent default related stuff for the next release. There are some problems with the current implementation. I have to think about how to do this correctly.

By then, I will soon provide a simple patch to give access to the original event and let the user prevent it if he wants. With the patched version, something like this will solve your problem:

$('#slider').on('drag', function(e) {
  if ('vertical' == e.orientation) {
    return;
  }

  e.originalEvent.preventDefault();
  // do my stuff...
});

ngryman avatar Jul 24 '13 03:07 ngryman

Released a patched version : 79d58e6a818598f1c79f120a0f86cd5f78ef9f94.

ngryman avatar Jul 28 '13 21:07 ngryman

This does not seem to wok. I did as above but it does not block vertical scrolling.

senner007 avatar Jul 31 '13 17:07 senner007

Ok. I will dig more deeply to find a satisfying solution for this.

ngryman avatar Aug 01 '13 03:08 ngryman

This release makes the code above work : https://github.com/ngryman/jquery.finger/releases/tag/v0.1.0-beta. Here is a live demo : http://jsfiddle.net/ngryman/dfgee/.

ngryman avatar Aug 03 '13 23:08 ngryman

It seems to be working now. The only problem is that the event is fired twice. ??? Also, it doesn't seem to work with the 'flick' event

senner007 avatar Aug 08 '13 20:08 senner007

Ok, this is perhaps related to #13.

ngryman avatar Aug 09 '13 00:08 ngryman

Could be, although it doesn't seem to be android related. You can see for yourself in the fiddle example you made.

senner007 avatar Aug 09 '13 11:08 senner007

have you fixed this issue?

siddo420 avatar Jul 04 '14 15:07 siddo420