未捕获的TypeError:undefined不是函数 - Javascript问题

时间:2015-01-28 23:44:57

标签: javascript jquery

为什么此代码会给我Uncaught TypeError: undefined is not a function错误?

它发生在第4行。

$featuredslider = $(".featured-slider")
if ($featuredslider.length > 0) {

    $featuredslider.royalSlider({ ********* error occurs here ********
        // options go here
        // as an example, enable keyboard arrows nav
        keyboardNavEnabled: true,

        tabs: {
            // thumbnails options go gere
            spacing: 0,
            arrowsAutoHide: true,
            fitInViewport: false,
            orientation: "vertical"
        }


    });

    slider = $featuredslider.data('royalSlider');

    slider.ev.on('rsAfterSlideChange', function(event) {
        if( $(window).width() < 481 ){

            //console.log($(slider.currSlide.content).data("slide"))
            $('.slide-overlay').removeClass("active");
            $('.slide-overlay[data-slide="'+ $(this).data("slide") +'"]').addClass("active")

        }
    });

}

0 个答案:

没有答案