fredleblanc / roundabout

A 3D Turntable jQuery Plugin.
645 stars 205 forks source link

click issue in Chrome mobile when drag is enabled #145

Open pixelatorz opened 10 years ago

pixelatorz commented 10 years ago

In chrome mobile you can not click the elements, except the part outside the container. The drag and drop on the parent element is blocking the clicks.

screen-shot-2014-03-12-at-17 43 47

when disabling the dragging the clicking works like a charm.

pixelatorz commented 10 years ago

In case someone has the same problem, you can fix it with disabling the drag and drop and Including hammer.js.

I Attached the animateToNextChild and animateToPreviousChild to the swipe and drag event that I trigger on the container.

var cross_selling = document.getElementById("cross-selling"); var cross_hammer = new Hammer(cross_selling, { drag_max_touches: 0 });

cross_hammer.on("dragleft", function(ev) {
  $('ul#carrousel').roundabout('animateToNextChild');
});
 cross_hammer.on("swipeleft", function(ev) {
 $('ul#carrousel').roundabout('animateToNextChild');
});

cross_hammer.on("dragright", function(ev) {
  $('ul#carrousel').roundabout('animateToPreviousChild');
});
 cross_hammer.on("swiperight", function(ev) {
 $('ul#carrousel').roundabout('animateToPreviousChild');
});