代码语法不正确(滚动条)

时间:2013-05-09 14:46:43

标签: javascript jquery scrollbar

我正在尝试实现this scrollbar并希望更改滚动惯性,但看起来我在下面的代码中出现了语法错误。你知道错误是什么吗? 非常感谢

<script>
    (function($){
        $(window).load(function(){
            $(".content_2").mCustomScrollbar()
            scrollInertia:150
        });
    })(jQuery);
</script>

3 个答案:

答案 0 :(得分:1)

更改

$(".content_2").mCustomScrollbar()
scrollInertia:150

通过

$(".content_2").mCustomScrollbar({
   scrollInertia:150
});

答案 1 :(得分:1)

您没有传入数据,而是试图以某种方式定义对象。

$(".content_2").mCustomScrollbar({
            scrollInertia:150
});

答案 2 :(得分:0)

 $(window).load(function(){
     $(".content_2").mCustomScrollbar({
          scrollInertia:150
     });      
 });

您应该看到这里的示例以便正确使用 -

http://manos.malihu.gr/jquery-custom-content-scroller/