Home

Awesome

jQuery Splitter

npm bower

jQuery Splitter is plugin that split your content with movable splitter between them.

Example

var splitter = $('#foo').height(200).split({
    orientation: 'vertical',
    limit: 10,
    position: '50%', // if there is no percentage it interpret it as pixels
    onDrag: function(event) {
        console.log(splitter.position());
    }
});
<div id="foo">
    <div id="leftPane">Foo</div>
    <div id="rightPane">Bar</div>
</div>

Limitations

You need to set the height of the container for splitter to work.

You can use this css:

.container {
  height: 100vh !important;
}

to force full height.

If you have wrappers inside left or right splitter and you create another splitter inside:

<div class="splitter"
  <div class="left">
    <div class="wrapper">
       <div class="top"></div>
       <div class="bottom"></div>
    </div>
  </div>
  <div class="right">
  </div>
</div>

wrapper is not directly inside left, so it will not get the full height (this is how CSS work), so in order to fix this case, you need to set the wrapper to proper height. Most likely you want:

.splitter .wrapper {
  height: 100%;
}

to fit full height of the left splitter.

Options

Methods

Instance returned by splitter is jQuery object with additional methods:

Demo

http://jquery.jcubic.pl/splitter.php

Patch Contributors

License

Copyright (C) 2010-2020 Jakub T. Jankiewicz <https://jcubic.pl/me><br/> Released under the terms of the GNU Lesser General Public License