Search code examples
jqueryhtmlcssjssor

Jssor: add vertical scrollbar when page is to long


I found this article however no valuable answer on it (jssor slider thumbnail scrollbar) In basic I want to be able to have a scrollbar vertical if the content is longer than the page. I thought to be smart to add "overflow-y : scroll;" but it seems the page goes through behind the end of the content container. So the solution would be (ideal) that the content container automaticcly adds scrollbar vertical when it detects that the page is longer than container or I can add a "overflow-y : scroll;" to a div in the container?

Anybody a workable solution? As in the example this will not work as I dont want to go to the next page vertical only horizontal

Looking forward to a response! )


Solution

  • 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
    });