malihu / malihu-custom-scrollbar-plugin

Highly customizable custom scrollbar jQuery plugin, featuring vertical/horizontal scrollbars, scrolling momentum, mouse-wheel, keyboard and touch support etc.
http://manos.malihu.gr/jquery-custom-content-scroller
MIT License
4.11k stars 1.51k forks source link

Scrollbar is not showing #582

Open hamidmehdizade opened 6 years ago

hamidmehdizade commented 6 years ago

Hello I used mCustomScrollbar in my project but the scrollbar is not showing. I don't think I missed anything, but it's still not working. Can you help me, please? Thanks.

ThPadelis commented 5 years ago

Can you provide some code? You need to set some css style in order to use mCustomScrollbar. Steps:

  1. Load the correct files
    • <link rel="stylesheet" href="/path/to/jquery.mCustomScrollbar.css" />
    • <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    • <script src="/path/to/jquery.mCustomScrollbar.concat.min.js"></script>
  2. Set height or width to your element that you want to have mCustomScrollbar
    • Either you use CSS ( for example )
      .content{
      height: 250px;
      }
    • Or you use JavaScript
      $(".content").mCustomScrollbar({
      setHeight: 250 // You can use 'integer' for pixels or 'string' for percentage e.g '25%' 
      });

And that's it.