无论如何我可以从“beforeSlide”方法中引用“mouseWheelEvent”属性吗?
$(document).ready( function() {
$(".main").hide();
var des = false;
var scorll = false;
var slider = $.fn.fsvs({
speed : 1000,
bodyID : 'fsvs-body',
selector : '> .slide',
mouseSwipeDisance : 40,
afterSlide : function(){},
beforeSlide : () => {
if($("#slide-3").hasClass("active-slide") && !des){
$('#fsvs-body').bind('mousewheel', function(e){
if(e.originalEvent.wheelDelta /120 > 0) {
console.log("up");
}
else{
$(".main").fadeIn(200, function(){
$("html").addClass("des");
$("#fsvs-body").addClass("des");
des = true;
scorll = false;
$('html, body').animate({
scrollTop: 200
}, 200);
console.log(scorll);
});
}
$('#fsvs-body').unbind('mousewheel');
});
}
},
endSlide : function(){},
mouseWheelEvents : scorll,
mouseWheelDelay : false,
scrollableArea : 'scrollable',
mouseDragEvents : true,
touchEvents : true,
arrowKeyEvents : true,
pagination : false,
nthClasses : false,
detectHash : true,
});
$(window).scroll(function(){
console.log($(document).scrollTop());
if(des){
if($(document).scrollTop() == 0){
$(".main").fadeOut(200, function(){
$("html").removeClass("des");
$("#fsvs-body").removeClass("des");
des = false;
console.log(scorll);
});
}
}
});
});
我想在beforeSlide和$(window).scroll中切换mouseWheelEvent,因为我希望鼠标滚轮在$(window).scroll中为真,在beforeSlide中为false。