Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
152
rated 0 times [  156] [ 4]  / answers: 1 / hits: 32920  / 8 Years ago, fri, november 11, 2016, 12:00:00

I am using perfect scrollbar for custom scroll bar. It is working fine.



But the scrollbar is visible only when you mouse over on the container.



How do I make this visible all the time?



$('.container').perfectScrollbar();


Demo


More From » jquery

 Answers
134

From the perfectscrollbar wiki:




How can I make the scrollbars always visible?



The reason why it's hidden by default is that opacity: 0 is used.
Please change all references of it to opacity: 0.6. If using .scss,
modify the line @include opacity(0) to @include opacity(0.6) in the
scrollbar-rail-default mixin and run gulp build to build .css and
.min.css files.



If you're not willing to modify the CSS files but would like to make
it always visible, please add following lines anywhere after
perfect-scrollbar.css is loaded.



.ps-container > .ps-scrollbar-x-rail,
.ps-container > .ps-scrollbar-y-rail { opacity: 0.6; }



Also, an example code may be helpful to see how to achieve it.




Here is example https://github.com/noraesae/perfect-scrollbar/blob/master/examples/always-visible.html



So, if you modify your JSFiddle by pasting the following into your html, it works.



<div class=container>
<div class=content></div>
</div>

<style>
.ps-container > .ps-scrollbar-x-rail,
.ps-container > .ps-scrollbar-y-rail { opacity: 0.6; }
</style>

[#60092] Wednesday, November 9, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yulisa

Total Points: 436
Total Questions: 102
Total Answers: 123

Location: Palau
Member since Tue, May 30, 2023
1 Year ago
;