1

I m using jquery's perfect scrollbar plugin "perfect-scrollbar" but I am encountering a problem with it.

It seems like the scrollbar exceeds the content instead of wrapping all the content when you scroll on it as you could see on my example site below (Note: click the "ADDITIONAL" to see the bug):

http://ec2-54-84-168-45.compute-1.amazonaws.com/Teapop/menu#teapop_nav

Can any one have a suggestion on how i can fix this?

Thank you

EternalHour
  • 8,308
  • 6
  • 38
  • 57
newbie
  • 14,582
  • 31
  • 104
  • 146
  • in Google Chrome 33.0.1750.117 perfect-scrollbar doesn't seem to show up – CIRCLE Feb 26 '14 at 17:11
  • Click the Additionals, then use your mouse scrollbar to scroll.. you could see that it exceeds the content and shows lot of white space – newbie Feb 26 '14 at 17:11
  • The solution to problem is [here](https://github.com/noraesae/perfect-scrollbar/issues/116). I haven't added any code as this needs to be done in perfect-scrollbar script and you are using minified version. So, even if I add it, you won't be able to find it and fix it. – Foreever Jun 19 '14 at 08:48

2 Answers2

0

Add this to your document [not tested]:

<script>
  $(document).ready(function(){
    function changeSize() {
        var width = parseInt($("#additional_menu_categories").width());
        var height = parseInt($("#additional_menu_categories").height());

        if(!width || isNaN(width)) {
            width = 600;
        }
        if(!height || isNaN(height)) {
            height = 400;
        }
        $("#additional_menu_categories").width(width).height(height);

        // update perfect scrollbar
        $('#additional_menu_categories').perfectScrollbar('update');
    }
    $(function() {
        $('#additional_menu_categories').perfectScrollbar();
    });
  });
</script>
CIRCLE
  • 4,501
  • 5
  • 37
  • 56
0

For people experiencing similar issue, Try the 1.4.0 version of Perfect-Scrollbar, it solved the issue for me.

Here's link of version I used:https://cdnjs.cloudflare.com/ajax/libs/jquery.perfect-scrollbar/1.4.0/perfect-scrollbar.min.js

I figured that the issue happens if I dynamically change the size, for example:(Transform:scale(0.5)), but the issue isn't present in the 1.4.0 version, weird..

Hope this helps.