最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - horizontal scrollbars with slimscroll - Stack Overflow

programmeradmin3浏览0评论

I use slimscroll for my scrolling needs and it works great. Now I have need for horizontal scrolling. A quick google search gives me some results to references in the github source code and some issues which indicates that that horizontal scroll support has been added but nowhere I can I find an example. I've looked in the javascript file expecting to find a flag to switch from vertical to horizontal. Helas nothing so obvious. So my question is it possible if yes, how? An example would be greatly appreciated.

I use slimscroll for my scrolling needs and it works great. Now I have need for horizontal scrolling. A quick google search gives me some results to references in the github source code and some issues which indicates that that horizontal scroll support has been added but nowhere I can I find an example. I've looked in the javascript file expecting to find a flag to switch from vertical to horizontal. Helas nothing so obvious. So my question is it possible if yes, how? An example would be greatly appreciated.

Share Improve this question asked Jul 4, 2014 at 9:49 wendellmvawendellmva 1,9442 gold badges27 silver badges34 bronze badges 1
  • can you consider using custom scrollbar -> manos.malihu.gr/tuts/jquery_custom_scrollbar.html – raviture Commented Jul 4, 2014 at 9:55
Add a ment  | 

5 Answers 5

Reset to default 8

The latest version of slimscroll is 1.3.1 (from github repository) and it does not support horizontal scrollbar. Try jQuery Scrollbar or any scrollbar that supports horizontal scrolling from this scrollbar parison table.

Now you can atualize your plug-in on the SlimScroll git repository, and just use the code below to instance your slimScroll

$('#testDiv').slimscroll({
    height: 150,
    width: 300,
    axis: 'both'
});

Slimscroll with both axes examples using Bootstrap 4.

Click here to see the online working examples.

I implemented ngSlimscroll, the rewritten version of the original slimscroll in AngularJS. It also supports horizontal scrolling. See the demo for example.

Did you try adding this code?

$(".content").mCustomScrollbar({
    axis:"x" // horizontal scrollbar
});

$(".content").mCustomScrollbar({
    axis:"yx" // vertical and horizontal scrollbar
});
发布评论

评论列表(0)

  1. 暂无评论