I have the following structure - jsFiddle:
HTML
Part1
- Elem1
- Elem2
- Elem3 ...
Part2
- Elem1
- Elem2
- Elem3 ...
Part3
- Elem1
- Elem2
- Elem3 ...
- Part1
- Part2
- Part3
#container {
float:left;
}
#controls {
float:right;
}
When I click on the controls the page moves to the selected part. That's the standard behavior. What I want is that the page stays and only the content of container
moves.
What is the easiest way to achieve this? Can it be done with pure CSS? Or maybe there is already a code snippet I could use?
My thoughts:
I can set overflow hidden for container
and when clicked set negative margin-top for content with JS. Is it the right way to do it?