简体   繁体   English

jQuery Slider localScroll和Cycle函数一起使用-不起作用

[英]jQuery Slider localScroll & Cycle function together - Not working

I am currently "trying" to implement both localscroll & cycle function together to create a slider. 我目前正在“尝试”一起实现localscroll和cycle功能,以创建一个滑块。 The slider is supposed to have two button (left and right) with an automatic cycle of rotation. 假定滑块具有两个按钮(左和右),并具有自动旋转周期。 The localscroll and the click function should have small buttons at the bottom where users can navigate to a certain image within the rotating slider. 本地滚动和单击功能应在底部具有小按钮,用户可以在其中导航到旋转滑块内的特定图像。

The cycle function works. 循环功能起作用。 But the localscroll function is not working. 但是localscroll功能不起作用。 Please view the JSFiddle 请查看JSFiddle

Error image 错误图片

jQuery: jQuery的:

    $(document).ready(function() {
        $("#slideshow").css("overflow", "hidden");
        $("#slideshow-nav").css("visibility", "visible");
    $("#slideshow-nav a[href=#lambo1]").addClass("active");

    $("#slideshow-nav").localScroll({
            target:'#slideshow', axis: 'x'
    });

$("#slideshow-nav a").click(function(){
            $("#slideshow-nav a").removeClass("active");
            $(this).addClass("active");
    });

    $("ul#slides").cycle({
            fx: 'fade',
            pause: 1,
            prev: '#prev',
            next: '#next'
    });

    $("#slideshow").hover(function() {
    $("ul#nav").fadeIn();
    },
            function() {
    $("ul#nav").fadeOut();
    });

}); });

You may want to try Nivo Slider . 您可能需要尝试Nivo Slider Out of the box it has the features you're looking for, plus a lot of options, if you need to customize. 开箱即用,它具有您要寻找的功能,如果需要自定义,还提供了很多选项。

<script type="text/javascript">
jQuery(window).load(function(){
jQuery("#nivoslider-4").nivoSlider({
    effect:"random",
    slices:15,
    boxCols:8,
    boxRows:4,
    animSpeed:500,
    pauseTime:3000,
    startSlide:0,
    directionNav:true,
    controlNav:true,
    controlNavThumbs:false,
    pauseOnHover:true,
    manualAdvance:false
});
});
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM