How to create full horizontal row with Split.js?

4.5k views Asked by At

I want to use Split.js for creating my specific layout like

full horizontal row

<div id="a" class="split split-horizontal">
</div>
<div id="b" class="split split-horizontal">
    <div id="d" class="split content"></div>
    <div id="e" class="split content"></div>
    <div id="f" class="split content"></div>
</div>
<div id="c" class="split split-horizontal">
</div>

<script>
    Split(['#a', '#b', '#c'], {
        gutterSize: 20,
        cursor: 'pointer'
    });
    Split(['#d', '#e', '#f'], {
        direction: 'vertical',
        sizes: [15, 70, 15],
        gutterSize: 20,
        cursor: 'row-resize'
    });
</script>

but above code does not work.

Can anyone help me? How can I create the layout with Split.js because does not exist any sample like that in their site?

Classic sample in JSFiddle

My Sample in JSFiddle

1

There are 1 answers

2
giorgio On BEST ANSWER

You where pretty close. First of all you didn't add content class to the left/right pain, so they didn't show. Then you mixed up the horizontal split. Here's a working fiddle.

<div id="a" class="split content"></div>
<div id="b" class="split">
    <div id="d" class="split content split-horizontal"></div>
    <div id="e" class="split content split-horizontal"></div>
    <div id="f" class="split content split-horizontal"></div>
</div>
<div id="c" class="split content"></div>

Split(['#a', '#b', '#c'], {
    gutterSize: 20,
    cursor: 'pointer',
    direction: 'vertical',
});
Split(['#d', '#e', '#f'], {
    sizes: [15, 70, 15],
    gutterSize: 20,
    cursor: 'row-resize',
});