1

Possible Duplicate:
How to create a custom scrollbar on a div

I'm having the following body

<div id="app-container">
    <div id="canvas-container">
        <div id="canvas"></div>
    </div>
</div>

In CSS I have:

#canvas {
  position: absolute;
  background-color: transparent;
  width: 100%;
  height: 100%;
}

#app-container {
  height: auto !important;
  min-height: 100%;
}

#canvas-container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

after that I'm adding divs (with jquery.appendTo and jquery.offset) to <div id="canvas"></div> with

display: inline-block;
position: absolute;

in CSS. So adding such a div cannot affect document size. If I add many divs some of them can be located below the edge of screen. How can I add a scrollbox, so that I can see all of divs?

Community
  • 1
  • 1
Eugeny89
  • 3,797
  • 7
  • 51
  • 98

1 Answers1

2

The property overflow: auto and height: (required height) inside the #canvas should make all the divs inside that visible.

I have used this few times in my application. Hope I didn miss anything thats very obvious.

LPD
  • 2,833
  • 2
  • 29
  • 48