I wrote this piece of code in order to display an horizontal scroll bar along a container of elements. The issue is that the bar is evident only when I put the cursor above the element. If the cursor is not put on the container with the elements, the bar is not evident, therefore the user may not be aware he has to scroll. Any idea about how to modify it in order to make the bar permanently visible?
$(window).scroll(function () {
sessionStorage.scrollTop = $(this).scrollTop();
});
$(document).ready(function () {
if (sessionStorage.scrollTop != "undefined") {
$(window).scrollTop(sessionStorage.scrollTop);
}
});
You can use overflow-x: scroll; for that element in a CSS rule to permanently display a horizontal scrollbar.