Splitter script

Splitter is a small JS script with no dependencies to create containers splitted horizontally or vertically with moveable splitter bar like the one below:

Drag this ->
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum ipsum repudiandae excepturi voluptates ipsa reiciendis perferendis. Atque at delectus hic dolorum minima quod adipisci voluptate officiis tempore architecto aliquid debitis?

The computed sizes are set in percent for sake of resizing. For now the splitter is 50% by default.

Creating a splitter

There are two types of splitters - vertical and horizontal. To split a div - add 'vertically_divided' or 'horizontally_divided' class to it (make sure the dive you are splitting has at least two child divs, which will be the halves of the div. Also make sure that an element has some height defined. Maybe later the automatic calculation will be added, but right now you have to define height explicitly.

<div class="vertically_divided" style="height:60px;"> <div>The left part</div> <div>The right part</div> </div>

The code above will produce the result below:

The left part
The right part

Of course, you can use CSS to add own style to everything:

Drag this ->
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rerum ipsum repudiandae excepturi voluptates ipsa reiciendis perferendis. Atque at delectus hic dolorum minima quod adipisci voluptate officiis tempore architecto aliquid debitis?

And, of course, you can nest several splitters:

Left part
Right part top left top
Right part top left bottom
Right part top right
Right part Bottom