mattbryson / TouchSwipe-Jquery-Plugin

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.
http://labs.rampinteractive.co.uk/touchSwipe/
Other
4.05k stars 1.68k forks source link

swipe with a little sliding #295

Closed oelbaga closed 6 years ago

oelbaga commented 8 years ago

I'm using swipe( { swipeStatus:swipe2, allowPageScroll:"vertical"} );

Is there any way to allow the div to slide a little as the user swipes?

jwdinker commented 7 years ago

@oelbaganwg You could do something like this....


$container.swipe({
            swipeStatus : function(event, phase, direction, distance, duration){

                    if(phase === 'move' && direction === 'left'){
                        $elementToTranslate.css({transform:'translateX(' + distance + 'px)'});                     
mattbryson commented 6 years ago

Closing as over a year old. Please feel free to re open if you are still having issues.