Call to action are not working inside scrollable sections of fullpage.js

时间:2016-06-18 20:17:00

标签: javascript jquery fullpage.js

I've embedded fullpage.js in my page and on the sections which have scroll in it, Links, submit buttons and checkboxes doesn't seems to be working in it. I tried putting an alert on click of a link for testing

$('.project-image').click(function(){
        alert('hola')
    })

even this simple thing is not working and there is no error on console. it looks like something is preventing clicks.

1 个答案:

答案 0 :(得分:0)

谢谢你们,我明白了。 删除switch case后:a.preventDefault();来自handleEvent:function(a)来自文件scrolloverflow.js所有链接现在都在工作。 我以前吓坏了,所以对于其他人我附上示例代码以供参考。

handleEvent: function(a) {
        switch (a.type) {
            case "touchstart":
            case "pointerdown":
            case "MSPointerDown":
            case "mousedown":
                this._start(a);
                break;
            case "touchmove":
            case "pointermove":
            case "MSPointerMove":
            case "mousemove":
                this._move(a);
                break;
            case "touchend":
            case "pointerup":
            case "MSPointerUp":
            case "mouseup":
            case "touchcancel":
            case "pointercancel":
            case "MSPointerCancel":
            case "mousecancel":
                this._end(a);
                break;
            case "orientationchange":
            case "resize":
                this._resize();
                break;
            case "transitionend":
            case "webkitTransitionEnd":
            case "oTransitionEnd":
            case "MSTransitionEnd":
                this._transitionEnd(a);
                break;
            case "wheel":
            case "DOMMouseScroll":
            case "mousewheel":
                this._wheel(a);
                break;
            case "keydown":
                this._key(a);
                break;
            case "click":
                this.enabled && !a._constructed && (a.preventDefault(), a.stopPropagation())
        }
    }

只需删除最后一个案例“点击”