A
A
Alexey Chertok2014-10-07 13:19:06
JavaScript
Alexey Chertok, 2014-10-07 13:19:06

How to make the page independent of the right scroll?

Good afternoon. I have a question, or rather a request to help me, to explain by what principle the site "VKontakte" made the position of the page, regardless of whether there is or is not a scroll on the right.

Those. the central part of the site is stationary when the scroll appears/disappears.
Can you please tell how you did it?

I say right away - jQuery is used, and the function is hung on the body onresize="bodyResize()". Those. no CSS plays a role here at all. As far as I understand, the width of the window is measured, and the width of the scroll, then an indent is made.

Thank you very much in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2014-10-07
@BarnyBroken

jsfiddle.net/egxc3e2v

M
Maxim, 2014-10-07
@iru

Fixing the width of the site is an order of magnitude smaller than the actual width of the display + an instruction to keep it in the center.
For starters, you can pay attention to getbootstrap.com , enough examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question