Split Pane jQuery plugin

I have created a jQuery plugin for adding split panes to you web site or web application.

Split panes can be nested. Component min-widths and min-heights are supported. I have not implemented support for max-width and max-height, yet.

Component size can be set programmatically.

I’ve tested the code in the latest versions of Chrome, Firefox and Safari on OS X, and in IE8 on XP.

The source code can be found at github.

Please give me you feed back!

Check out the following pages for examples on how to use it:

N.B., not all markup in the examples are needed for setting up the split panes. <div class="pretty-split-pane-frame"> and <div class="pretty-split-pane-component-inner"> are used for styling purposes only. Feel free to use them, but you might want to style things your own way.

39 Responses to Split Pane jQuery plugin

  1. Hi Simon,

    Woks absolutely great and quite simple to use !
    I am impressed by your blogs and the broad technical knowledge you show.
    Thanks for sharing,


  2. Hi Simon – I like the plug in. Thank you very much! One thing I feel is missing is the “outline” mode that was supported in Dave Methvin’s splitter (I was using it until recently but decided to move on because it does not work with jQuery over 1.4). It allows the user to move the “zombie” divider and only resize split panes ONCE on mouseup. I work on enterprise business apps with dashboards and the issue with immediate resize is that IF the contents of the panes are large scrollable grids (fit to the pane sales orders, inventory parts, etc), the browser behavior becomes jerky when the divider is moved. Your code is very clear and I was able to make minimal modifications to it to support the outline by cloning the divider on mousedown (borrowed from Dave’s approach). However, it’s not the prettiest solution because of how the resizing math is currently packaged in createMousemove. Just a suggestion, in case you are planning to improve the plugin in the future. I don’t think there is anything lightweight of similar quality and functionality out there.

    • Thanks for the feedback! I have also worked with visualizing large datasets, so I’m familiar with your problem. It’s a good suggestion, I will definitely consider implementing that.

  3. Can it support bootstrap responsive layout inside splitter div. Means if resize splitter by split bar then it make div responsive?

    • That shouldn’t be a problem. Using container-fluid is probably best. One thing to keep in mind is that media queries, controlling when phone/tablet/desktop layouts are used, react on browser width not split-pane-component width.

  4. Split screen desktop view working very perfect, but not working touch screen tab and mobile. Please help me any solution.

    • Please try version 0.5.2 and let me know if that version solved your problem. A have fixed a touch related bug in that version.

  5. What’s the correct way to put a non-resizable bar across the top of the page? I tried to add a regular div above the split pane ones and ended up with a vertical scrollbar on the page. I tried to wrap it in a container, but all of the split pane divs shrunk down to minimum size. The wrapping method I used was from http://jsfiddle.net/naqE6/

    • Banner and main divs need to be position: absolute; width: 100%; left: 0. Main top = banner height. Main bottom = 0.

      		<div class="banner">BANNER</div>
      		<div class="main">
      			<div id="split-pane-1" class="split-pane fixed-left">
      				<div class="split-pane-component" id="left-component">
      					This is the left component
      				<div class="split-pane-divider" id="divider"></div>
      				<div class="split-pane-component" id="right-component">
      					This is the right component

      You will find a working example here

  6. Is it tested in Android OS? i I tried to test your example page “Vertical divider with right and left component widths in percent”. It works fine in iOS – iphone, but not worked in Android OS – tablet PC. I opened the page in Chrome and the version of android is 4.4.4. plz reply. Thank you.

  7. Can I add listener that is called after resizing. I need store these values on server – I need persist widths.

    Thank You.

    • Version 0.7.0 supports this. Split pane fires dividerdragstart and dividerdragend events.

      $('div.split-pane').on('dividerdragend', function (event, obj) {
        if (event.target === this) {
  8. I found your plugin to be the best of all tried, especially since it is current code, unlike some plugins that have been abandoned and no longer run on the current framework. One question: I found all functionality to fail (no panes) when JQuery Mobile js is added to the HTML file. Much of the content I need to work with has JQMobile dependencies. Did I setup my demo file incorrectly, or is there a mismatch with Split Pane when JQM is added on top of JQ, but before Split Pane?

  9. Thank you so much, great piece of code, nice job!
    I’m using it for a webpage that will be mostly viewed on mobile devices. I tested it on my Android mobile (S5 neo, 5.1.1) with latest chrome app and it works just fine.
    Tested it now also with firefox and samsung browser were it does not work. The slider is highlighted but does not move.
    Do you have an idea why?
    Thanks a lot!

  10. Very good plugin! Thank you, Simon!

    One question: can I add panes dynamically e.g – divide exist pane to two panes vertically or horizontally by some button click event? Or I will need init split-pane, add new DOM elements and after that re-init split-pane again?

    Thank you!

    • Yes, you should be able to add a pane dynamically. Just run $(newPane).splitPane(); on the added pane.

      Removing a pane could work, if it’s being done using any jQuery method, for example .remove() or parent.html(”).

  11. Hi there! I’m trying to implement split panes inside Angular and can’t get past an error: Uncaught TypeError: Cannot read property ‘offsetWidth’ of undefined on line 167
    Any suggestions?

  12. I just started to use split pane, but I got the error
    TypeError: internalHandler is not a function. (In ‘internalHandler(event)’, ‘internalHandler’ is undefined) at line 34.
    I use JQuery 1.12.1

  13. Is there a MAX Width property for panels?

    Is there a way to disable resize and just have click to exand/click to collapse>

    Excellent work!

    • max-width is not implemented. I’ve been wanting to do that for a long time but haven’t had time yet. Disabling dragging has not been implemented either, but would make a useful feature.

  14. how can I have a fixed left panel, and one right panel that contains two hozitonzal rows where the first row contains two vertical columns? help me please… thanks

  15. Hi Simon, is neccesary to explicit the divider divs in my html?
    ( i.e. )
    Doesn’t your plugin add them programmatically when needed?


    • Sorry, I posted html as example but it was stripped. I wanted to put…
      <div class="split-pane-divider"></div>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>