Check out this jsfiddle: http://jsfiddle.net/devboell/kjFps/
I am trying to create a div that overflows both horizontally and vertically. Additionally, I need an element that scrolls only horizontally while remaining fixed vertically.
Here is an explanation of the code:
- There is a main
container
div with a singlebackground
div that is double the size of thecontainer
in both horizontal and vertical directions. - The
scale
div should always be visible at the top of thecontainer
, scrolling horizontally. - I attempted to split the
background
div intobackgroundHorizontal
andbackgroundVertical
, positioning thescale
absolutely withinbackgroundHorizontal
. - However, when scrolling down, the
backgroundVertical
pushes thescale
out of view.
In addition to this issue, I have another requirement regarding the visibility of the vertical scrollbar. It should always be visible rather than appearing only when scrolling all the way to the right as it currently does.
Thank you for your help!