Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed Position div Vertical Only

I have a current web build with a right sidebar that is a fixed position. I have tried to positioning from the right but don't want it overlapping other divs content.

What I am looking for is to have the content scrollable horizontally to the right when it is out of the viewport window. Any help would be greatly appreciated.

similarly to this: http://demo.rickyh.co.uk/css-position-x-and-position-y/ however I can not get this working.


This has been solved by alternative method. Thanks for those who actually considered helping.

like image 819
user720033 Avatar asked May 20 '11 04:05

user720033


1 Answers

Keep the fixed div.

And have the following javascript code which will take care of horizontal moving.

$(window).scroll(function(){
  $('.fixed_div').css('left',-$(window).scrollLeft());
});
like image 80
Vimalkumar Kalimuthu Avatar answered Oct 01 '22 12:10

Vimalkumar Kalimuthu