after disable() the scroll, i can not trigger the click event

29 views
Skip to first unread message

Micle Scrofield

unread,
Mar 17, 2016, 3:36:14 AM3/17/16
to iScroll
  1. inistal:
var myScroll = new IScroll('#mainBody', {
            scrollX: true,
            scrollY: false,
              click: true,
            momentum: false,
            snap: true,
            scrollbars: false,
            bounce: false,          
            mouseWheel: false,
            disableTouch: false,
            tap: true
        });

 myScroll.on("scrollEnd", scrollEnd);
        function scrollEnd() {
            console.log(this.currentPage.pageX); 
            switch (this.currentPage.pageX) {
                case 1:
                case 3:
                case 4:
                case 5:
                case 6:
                 
                    break;
                case 1:
                case 8:
                case 9:
                case 10:
                case 11:
                     myScroll.disable();   //here will disable the myScroll
                    break;
            }

        }

2 . click event:
 $("#bottom_gobtn").click(function () {

        myScroll.goToPage(2, 1, 1000);
    });
3.

problem: when after run the myScroll.disable(),  the click Event can not been trigger? any solution?
Reply all
Reply to author
Forward
0 new messages