How to impose fixed block to scrollers horizontally?

Hi all.
Often meet with a fixed top header with menu on one-page sites that scroll across the page for convenience.
However, not always required adaptability of the units of its components - and often even a fixed width document.
Noticed that if the browser width is less than the fixed width of the document, then there is horizontal scrolling and that's fine.
But when you scroll the horizontal scroll the above-mentioned fixed block-menu does not scroll with the document.
Maybe someone already faced with the need to solve this problem and have already decided?
Anyone have any ideas?
September 26th 19 at 07:18
2 answers
September 26th 19 at 07:20
Solution
send a link to the code
jsfiddle.net/9Mg8g example - fredy_Me commented on September 26th 19 at 07:23
so this is norms of behavior. You commit and set 100% width of the screen as a fixed unit in relation to the screen when you scrollto that scrolls the document and not the Eran - Sandy.Casper97 commented on September 26th 19 at 07:26
solved only through js - Sandy.Casper97 commented on September 26th 19 at 07:29
as it is necessary to change the type of positioning - Sandy.Casper97 commented on September 26th 19 at 07:32
thank you - fredy_Me commented on September 26th 19 at 07:35
September 26th 19 at 07:22
Solution
If I understand correctly Your description is the behavior most likely quite a normal.
Think You mean this: codepen.io/iiil/pen/wHgfG
the header behaves as he would behave during vertical scrolling. That is positioned relative to the visible part of the screen.
Yes Yes, behaves in a predictable and normal. the question is how to make a crutch that it is also possible to scroll. maybe besee there is a solution)) - fredy_Me commented on September 26th 19 at 07:25
view the example one more time, have thrown the option of jq.
Styles do not work, because fixed is fixed.
codepen.io/iiil/pen/wHgfG - Sandy.Casper97 commented on September 26th 19 at 07:28
thank you very much :)
found the same option for cross-browser execution of the function of location shift javascript.ru/ui/offset#popytka-2:-getboundingclie... - Sandy.Casper97 commented on September 26th 19 at 07:31

Find more questions by tags CSSHTML