This website uses cookies to personalise ads and to analyse traffic ok
web design

jQuery custom content scroller


Code examples and tutorials

Responsive custom scrollbar with CSS3 media queries

How to use custom scrollbar plugin with CSS3 media queries and switch between vertical and horizontal scrollbars according to viewport size.

Scroll to id within element with custom scrollbar(s)

A simple jquery function to make all links pointing to id attributes within the page, work on content with custom scrollbars.

Horizontal custom scrollbar tutorial

Extensive tutorial for creating horizontally stacked content with the custom scrollbar plugin.


Pages: 1 2 3 4


Post a comment

Comments pages: 1 81 82 83

  1. Farshad
    Posted on January 4, 2022 at 20:25 Permalink

    I can not change the default to the horizontal axis

    $(“#metro-box”).mCustomScrollbar({axis: “x” });

    would you help me plz

    • Greg Young
      Posted on January 10, 2022 at 01:50 Permalink

      use a class, not a div 😉

  2. Borsa
    Posted on December 28, 2021 at 05:35 Permalink

    How can I decrease the width of the background of the scroll bar.

  3. Pierre Att
    Posted on December 20, 2021 at 18:58 Permalink

    Suppose you scroll over a set of div, each one having an id.

    Is there’s a way to have a trigger enabling to run a function each time one of the div is displayed whatever the scrolling is down or top ?

    Thanks for quick directions,


  4. Aman
    Posted on December 2, 2021 at 16:03 Permalink

    This is really amazing post, thanks for sharing.

  5. Samantha
    Posted on August 18, 2021 at 22:13 Permalink

    The plug in seems not working very well with newer Jquery version like JQuery 3.5.1 .

    Is there any chance you can fix that.

    Big thanks

  6. shahil
    Posted on April 26, 2021 at 15:39 Permalink

    is it possible to scroll the content with mouse drag ?

  7. sagar
    Posted on February 4, 2021 at 08:07 Permalink

    Can you please make it compatible with the jQuery Latest version.. There are many themes and plugins which uses your custom scrollbar.. I would request you to do that..

    I saw jQuery.fn.bind() is deprecated in the plugin of yours…

    • Rosáline
      Posted on May 9, 2021 at 20:12 Permalink

      Agreed! The scroll on the latest jQuery version is so janky

  8. imko
    Posted on January 6, 2021 at 19:21 Permalink

    If you have problems displaying the horizontal slider on mobile devices set parameter “autoHideScrollbar” to “false”

  9. W.
    Posted on September 28, 2020 at 20:58 Permalink

    Hi there is a problem on new safari in Iphones, if you have text only container its work well, but if you have clickable elements, when you hit that element(e.g. a href) it stop scrolling and start hover that elemen and you cant scroll further.
    best regards. W.

  10. User
    Posted on July 30, 2020 at 22:39 Permalink

    contentTouchScroll is not working while swiping left and right in mobile. Kindly provide me any solution for this.
    Thank you

  11. Rebeka
    Posted on June 22, 2020 at 12:02 Permalink

    Download free all source WordPress, Plugin, Html templates, Psd…

  12. Rebeka
    Posted on June 22, 2020 at 11:57 Permalink

    Download free all source WordPress, Plugin, Html templates, Psd… at:

  13. Stefanie
    Posted on June 17, 2020 at 10:48 Permalink

    I have made the content of my scroller responsive, okay. But how can i adjust the “snapAmount” to the different values of height?

    Thank you for help.

  14. Web Inmotion
    Posted on May 29, 2020 at 08:43 Permalink


    We are using mCustomScrollbar and it’s working fine.

    while working with this… iFrame content on website gets removed.

    Can you suggest suitable solution for this ?
    Thank you.

  15. sergey
    Posted on May 9, 2020 at 12:33 Permalink

    error with jquery v3.5.1

  16. Carl
    Posted on April 21, 2020 at 06:21 Permalink

    trying to scrollTo a position in modal-body(fixed heigth and overflow-y:auto) from the main page when open the modal. I get the proper #id and listen for when its open
    $("#Modal").on('', function(){ $('#content').mCustomScrollbar('scrollTo',"#id"); });
    and nothing happens
    Any suggestions

  17. Antoine
    Posted on April 17, 2020 at 00:08 Permalink

    is there a way to get mouseWheel back on body/html when onTotalScroll ?
    I tried, but I can’t figure how…
    Best regards,

  18. Guest
    Posted on January 23, 2020 at 11:52 Permalink

    I am using Malihu scrollbar in my application but I am not able to use the scrollbar in mobile devices. please reply with solution

  19. Ponnarasi
    Posted on January 2, 2020 at 14:18 Permalink

    I have implemented jQuery UI sortable in my project. In my implementation I have large number of records which around 10,000 at an average. I store the index of each record in my database.

    The implementation is working fine but due to mCustomScrollbar, the sorting feature is very jerky. The scrolling do not work properly when I reach last visible record.

  20. Oguzhan
    Posted on December 25, 2019 at 08:34 Permalink

    Hello Malihu,

    I’m asking you to help me with something I’m stuck with.

    I have prepared a modal plugin.
    When it reaches the maximum height, mCustomScrollbar is activated.
    It works super.

    Only I have Selectize on my form pages.
    You cannot scroll through the Selectize menu with the mouse.
    The mouse works for mCustomScrollbar.

    I used the following parameter to cancel scrolling while on the Selectize element.
    But it didn’t work.
    The .selectize-control element is the top layer.

    Is there anything wrong?

    articlectnscroll.mCustomScrollbar({ theme: "minimal-dark", mouseWheel: { disableOver: ['.selectize-control', '.selectize-control *'] } });

    (Sorry, I used google translate for english)

    • Poonam
      Posted on January 18, 2020 at 08:43 Permalink


      Did you got any solution for your problem.Recently I am facing same problem

  21. Murat
    Posted on December 3, 2019 at 05:15 Permalink

    is this project alive?

  22. Elle
    Posted on November 14, 2019 at 06:39 Permalink

    Is there a way to make it work along with NodeJS and EJS? It seems to be buggy and won’t scroll properly

  23. beni
    Posted on November 11, 2019 at 16:40 Permalink

    How can i use mCustomScrollbar for browser default scrollbar?

    • beni
      Posted on November 11, 2019 at 16:43 Permalink

      I used:
      $("body").mCustomScrollbar({ theme: "minimal", scrollButtons: { enable: true } });

      but dose not work.

  24. Bhavesh Vengurlekar
    Posted on October 4, 2019 at 10:20 Permalink

    I have to make the 1st section to sticky to top when I perform wheelscroll and also when I click on the link to go to specific section.

  25. Dave
    Posted on September 20, 2019 at 16:05 Permalink

    Is there a Tutorial or video to use jQuery custom content scroller with the Elementor Page Builder – this is brilliant and exactly what I need for my site!

  26. Marc
    Posted on September 19, 2019 at 16:11 Permalink

    I have an images slider inside the mCustomScrollbar and in mobile devices I can not swipe left this slider, because mCustomScroll prevents it. Is it possible to make Stop Propagation? Thanks!

  27. Marth
    Posted on August 13, 2019 at 02:39 Permalink

    Is there a way within the plugin to hide the scrollbar but leave the arrow buttons for scrolling?

  28. Peter
    Posted on August 10, 2019 at 16:46 Permalink

    How can I User mCustomScrollbar and AutoComplete

    /* scroll via keyboard */
    var first=$(“.ui-autocomplete li:first”);
    var el=$(“.ui-state-focus”).parent();
    if(!“:mcsInView”) && !“:hover”)){

    This code not working

  29. codepopular
    Posted on July 11, 2019 at 23:11 Permalink

    Download Free html Template

  30. Yvan COYAUD
    Posted on June 17, 2019 at 01:15 Permalink

    How can I decrease the width of the background of the scroll bar.
    I’m talking about reducing the size of the scroll bar, which is too far from the content to scroll.
    Thank you for your help



Comments pages: 1 81 82 83

Post a comment

Your e-mail is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can write or copy/paste code directly in your comment using the <code> tag:
<code>code here...</code>
You may also use the data-lang attribute to determine the code language like so:
<code data-lang-html>, <code data-lang-css>, <code data-lang-js> and <code data-lang-php>