I am working on a project and there I have used perfect scrollbar all works fine until I have converted my project to support rtl mode.
The Scrollbar works perfectly when used with or without suppressScrollX : true
in ltr mode but when comes to rtl mode it works perfectly without suppressScrollX :true
when once I set this parameter it shift my content to the left.
When I inspected I saw that the scroll is automatically increasing the number from left.
Note : I am using suppressScrollX :true
to remove horizontal scrollbar
Here is my example code
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="perfect-scrollbar.css">
<style>
html {
direction: rtl
}
#container {
position: relative;
width: 600px;
height: 400px;
}
</style>
</head>
<body>
<div id="container">
<img src="https://images.pexels.com/photos/2098427/pexels-photo-2098427.jpeg">
</div>
<script type="text/javascript" src="perfect-scrollbar.min.js"></script>
<script type="text/javascript">
const ps = new PerfectScrollbar('#container', {
suppressScrollX : true
});
</script>
</body>
</html>
Download working example