How do I get a fixed position div to scroll horizontally with the content? Using jQuery
The demo is keeping the element’s position:fixed and manipulating the left property of the element: var leftInit = $(“.scroll_fixed”).offset().left; var top = $(‘.scroll_fixed’).offset().top – parseFloat($(‘.scroll_fixed’).css(‘margin-top’).replace(/auto/, 0)); $(window).scroll(function(event) { var x = 0 – $(this).scrollLeft(); var y = $(this).scrollTop(); // whether that’s below the form if (y >= top) { // if so, ad the fixed … Read more