Flexslider,在最后一张幻灯片之后/上方禁用鼠标滚轮 [英] Flexslider, Disable mousewheel after/on the last slide

查看:57
本文介绍了Flexslider,在最后一张幻灯片之后/上方禁用鼠标滚轮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用鼠标滚轮在幻灯片之间滑动.我拥有的滑块是全屏的,因此您无法滚动通过它.效果很好,但是我想禁用flexslider的鼠标滚轮功能,以便在最后一张幻灯片上可以自由滚动通过它或返回到上面.目前,我有以下内容:

I am currently using mouse-wheel to go from slide to slide. The slider I have is full screen so you cannot scroll passed it. This works out great, but I want to disable the mousewheel function of the flexslider so that on the last slide they can scroll freely either passed it, or back above it. I currently have the follow:

 $('#main_slider .flexslider').flexslider({
      animation: "fade",
      animationSpeed: 650,
      move: 1,
      controlNav: false,
      directionNav: false,
      mousewheel: false,  
      animationLoop: false,
      start: function(slider){
        $('body').removeClass('loading');
      },
      before: function(slider){

        //console.log(slider)

        //  Determine which slide we're moving to
          // slidingTo = slider.animatingTo;
          //console.log('sliding to: '+slidingTo);

          $('.flexslider .slides > li').removeClass('hovered');
      },
      after: function(slider){

        $('.flex-active-slide').addClass('hovered');
        //console.log('triggered mouse');
        if (slider.currentSlide == 1) { // TO SEE IF THE CURRENT SLIDE IS 2 TEST...
          $('.flex-active-slide.hovered').css('background','blue')
        }
        if (slider.currentSlide == 2) { // TO SEE IF THE CURRENT SLIDE IS 3 TEST...
          $('.flex-active-slide.hovered').css('background','red')
        }

      },
      end: function(){

        slider.pause();

        WHAT GOES HERE TO DISABLE THE FLEX SLIDER MOUSE-WHEEL FUNCTION??

      }
    });

推荐答案

这最终解决了问题(在end函数中使用了)

this ended up doing the trick (went in the end function)

$('#main_slider .flexslider').unmousewheel();

这篇关于Flexslider,在最后一张幻灯片之后/上方禁用鼠标滚轮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆