Is it possible to make something like this:
When the scroll bar is used, only the content from the div in which the messages are scrolls.
Does somebody know how to do this in css?
Asked
Active
Viewed 737 times
0
-
1One way to do it is by using absolute positioning on everything EXCEPT the container that you want to scroll. – Shmiddty Aug 21 '12 at 17:52
2 Answers
1
Sure you can do this with pure css; position property, no need jQuery.
Use css position:fixed;
on element's you don't want to scroll and use css values float:left;
or position:relative;
on content areas you want to scroll.
But if you want to stick some element's according to scroll.top
value, you need to use jQuery. I suggest to inspect these answer for it: How to build simple sticky navigation at the page bottum? and Setting CSS value limits of the window scrolling animation

Community
- 1
- 1

Barlas Apaydin
- 7,233
- 11
- 55
- 86
-
Thanks for your answer. Now I have the followin problem: It shoud look like: http://jsfiddle.net/mkCsy/ But it looks like: http://jsfiddle.net/ESF3P/ How I can fix the floatings? – htw Aug 21 '12 at 23:40
-
1if you gonna use `position` property, you need to define `top` and `left` values for positioning element. and don't forgot to define position:relative to wrapper for defining child element's baz position. did you want to do this: http://jsfiddle.net/ESF3P/6/ – Barlas Apaydin Aug 22 '12 at 18:35
0
Yes, this is very possible. For the objects that shouldn't scroll, specify:
position: fixed;
in its CSS selector.

Winfield Trail
- 5,535
- 2
- 27
- 43