Jssor:当页面长时添加垂直滚动条

时间:2015-02-27 18:08:57

标签: jquery html css jssor

我发现这篇文章没有重要的答案(jssor slider thumbnail scrollbar) 在基本的情况下,如果内容比页面长,我希望能够使滚动条垂直。 我认为要聪明地添加" overflow-y:scroll;"但似乎页面遍历内容容器的末尾。 所以解决方案将是(理想的)内容容器在检测到页面长于容器时自动添加滚动条垂直或者我可以添加" overflow-y:scroll;"到容器中的div?

任何人都有可行的解决方案吗? 如在示例中这不起作用,因为我不想转到下一页垂直仅水平

期待回复! )

1 个答案:

答案 0 :(得分:1)

var options = {

    $AutoPlay: true,                                   //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false
    $DragOrientation: 1                                //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0)
};

var jssor_slider1 = new $JssorSlider$("slider1_container", options);

jssor_slider1.$On($JssorSlider$.$EVT_POSITION_CHANGE, function (position, fromPosition) {
    //it fires while sliding
});

jssor_slider1.$On($JssorSlider$.$EVT_PARK, function (slideIndex, fromIndex) {
    //it fires when current slide swith to another
});