Reputation: 14950
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
Upvotes: 1
Views: 3505
Reputation: 1
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.
Upvotes: 0
Reputation: 4869
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>
Upvotes: 0