Even though this topic has been discussed numerous times, I have not found any solutions that work for me. My webpage has a sidebar on the left with position:fixed
in CSS, and I want it to scroll horizontally along with the rest of the content.
For the header and footer, I used the following solution:
$(window).scroll(function ()
{
$("header,footer").css('margin-left', -($(window).scrollLeft()) + "px");
});
However, this approach does not work properly for the sidebar. Here is the HTML for my sidebar:
<div class="fullscreen_block hided">
<div class="left-sidebar-block">
And here is the CSS:
.left-sidebar-block {
position: fixed;
margin-left: 70px;
}
Can someone please help me fix this without using the above JavaScript code? I am open to using other JavaScript, CSS, or jQuery solutions.
Thank you!