basilio / responsiveCarousel

Simple carousel
MIT License
113 stars 64 forks source link

Item not clickable & cant trigger mouseover function while on mobile with visible item 1 #12

Open mohdhazwan opened 10 years ago

mohdhazwan commented 10 years ago

Hi

I found that for item with link not clickable and mouseover effect not working while on mobile. You need a long press in order trigger the mouseove function. I think it caused by swipe function.

skrichten commented 10 years ago

Kind of a quick and dirty fix. I changed the touchend event handler to only preventdefault if the swipe actually executes...

.on('touchend', function(e){
                    defaults.swipeDistance = defaults.endCoords.pageX - defaults.startCoords.pageX;
                    if( defaults.swipeDistance >= defaults.swipeMinDistance ){
                        // swipeLeft
            e.preventDefault();
            e.stopPropagation();
                        obj.previous();
                    } else if( defaults.swipeDistance <= - defaults.swipeMinDistance ){
                        // swipeRight
            e.preventDefault();
            e.stopPropagation();
                        obj.next();
                    }
                    $('.touching').off('touchmove').removeClass('touching');
                });
mahony0 commented 8 years ago

years past, but same issue persists. Is this have a fix without hacking the base codes?

skrichten commented 8 years ago

It looks like a very similar fix to my code above was added back in April...

https://github.com/basilio/responsiveCarousel/commit/75aa385222d6ea6686c6daed09b3d0e84aa5cc2f