lukesnowden / FSVS

Full Screen Vertical Scroll
https://www.lukesnowden.co.uk/full-screen-vertical-scroll/
723 stars 145 forks source link

slide on click slideup #47

Open maddack opened 4 years ago

maddack commented 4 years ago

great source i have a question Click on the slide to slide up. I do not want this action. What JavaScript should I fix? Thanks Warm Regards

muscle-rabbit commented 3 years ago

@maddack I had a same issue. I solved it by commenting out below.

// in bundle.js

var bindMouseDrag = function() {
    function isScrollable(element) {
        return element.parents( '.' + options.scrollabelArea ).length != 0 ;
    }
    var x, y;
    // window.onmousedown = function(e) {
    //  var cancelOn = ['a','input','textarea','select'];
    //  if( $.inArray( e.target.nodeName.toLowerCase(), cancelOn ) != -1 && isScrollable( $(e.target) ) ) {
    //      cancel = true;
    //  } else {
    //      y = e.y;
    //      cancel = false;
    //  }
    // }
    window.onmouseup = function(e) {
        if( e.y > ( y+options.mouseSwipeDisance && !cancel ) ) {
            app.slideUp();
        } else if( e.y < ( y-options.mouseSwipeDisance && !cancel ) ) {
            app.slideDown();
        }
    }
};

FYI: I found out the point that fire when mouse was down. https://www.tutorialspoint.com/How-to-find-out-which-JavaScript-events-fired I checked a whole mouse event in the debugger.

thanks.