我的页面和包含滚动,链接,提交按钮和复选框的部分中都嵌入了fullpage.js。我尝试在单击测试链接时发出警报
$('.project-image').click(function(){
alert('hola')
})
即使这个简单的东西也无法正常工作,并且在控制台上也没有错误。看起来有些东西阻止了点击。
谢谢大家,我想出了。删除开关案例后:A.PreventDefault();从handerevent:函数(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())
}
}
只需删除最后一个情况"单击"