SAMYANG/m/asset/js/sy.m.plugin.js
/* Detecting touch events

        * As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.
        * This way, the touchstart and the touch moves shows an small difference between them which is the
        * used one to determine the direction.
        */
Detecting touch events
As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.
This way, the touchstart and the touch moves shows an small difference between them which is the
used one to determine the direction.
Detecting touch events As we are changing the top property of the page on scrolling we can not use the traditional way to detect it . This way the touchstart and the touch moves shows an small difference between them which is the used one to determine the direction .
function touchMoveHandler(event) {
            var e = event.originalEvent;
            var activeSection = $(e.target).closest(SECTION_SEL);
            if (isReallyTouch(e)) {
                if (options.autoScrolling) {
                    event.preventDefault();
                }
                var touchEvents = getEventsPage(e);
                touchEndY = touchEvents.y;
                touchEndX = touchEvents.x;
                if (activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) {
                    if (!slideMoving && Math.abs(touchStartX - touchEndX) > ($window.outerWidth() / 100 * options.touchSensitivity)) {
                        if (touchStartX > touchEndX) {
                            if (isScrollAllowed.m.right) {
                                moveSlideRight(activeSection); 
                            }
                        } else {
                            if (isScrollAllowed.m.left) {
                                moveSlideLeft(activeSection); 
                            }
                        }
                    }
                }
                else if (options.autoScrolling && canScroll) {
                    if (Math.abs(touchStartY - touchEndY) > ($window.height() / 100 * options.touchSensitivity)) {
                        if (touchStartY > touchEndY) {
                            scrolling('down');
                        } else if (touchEndY > touchStartY) {
                            scrolling('up');
                        }
                    }
                }
            }
        }
function touchMoveHandler ( event ) { var e = event . originalEvent ; var activeSection = $ ( e . target ) . closest ( SECTION_SEL ) ; if ( isReallyTouch ( e ) ) { if ( options . autoScrolling ) { event . preventDefault ( ) ; } var touchEvents = getEventsPage ( e ) ; touchEndY = touchEvents . y ; touchEndX = touchEvents . x ; if ( activeSection . find ( SLIDES_WRAPPER_SEL ) . length && Math . abs ( touchStartX - touchEndX ) > ( Math . abs ( touchStartY - touchEndY ) ) ) { if ( ! slideMoving && Math . abs ( touchStartX - touchEndX ) > ( $window . outerWidth ( ) / 100 * options . touchSensitivity ) ) { if ( touchStartX > touchEndX ) { if ( isScrollAllowed . m . right ) { moveSlideRight ( activeSection ) ; } } else { if ( isScrollAllowed . m . left ) { moveSlideLeft ( activeSection ) ; } } } } else if ( options . autoScrolling && canScroll ) { if ( Math . abs ( touchStartY - touchEndY ) > ( $window . height ( ) / 100 * options . touchSensitivity ) ) { if ( touchStartY > touchEndY ) { scrolling ( 'down' ) ; } else if ( touchEndY > touchStartY ) { scrolling ( 'up' ) ; } } } } }
Detecting touch events
 As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.
Detecting touch events As we are changing the top property of the page on scrolling we can not use the traditional way to detect it .
// additional: if one of the normalScrollElements isn't within options.normalScrollElementTouchThreshold hops up the DOM chain //preventing the easing on iOS devices //if movement in the X axys is greater than in the Y and the currect section has slides... //is the movement greater than the minimum resistance to scroll? //next //prev //vertical scrolling (only when autoScrolling is enabled) //is the movement greater than the minimum resistance to scroll?