Split.js 四个可移动方格

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Split.js Four Panes Demo</title>
    <script src="https://unpkg.com/split.js/dist/split.min.js"></script>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            font-family: Arial, sans-serif;
        }
        
        .split-container {
            display: flex;
            height: 100vh;
            width: 100%;
        }
        
        .pane {
            overflow: auto;
            position: relative;
        }
        
        .pane-content {
            padding: 15px;
            height: 100%;
            box-sizing: border-box;
        }
        
        .gutter {
            background-color: #eee;
            background-repeat: no-repeat;
            background-position: 50%;
        }
        
        .gutter.gutter-horizontal {
            background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
            cursor: col-resize;
        }
        
        .gutter.gutter-vertical {
            background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
            cursor: row-resize;
        }
        
        .pane-1 { background-color: #f0f8ff; }
        .pane-2 { background-color: #fff0f5; }
        .pane-3 { background-color: #f0fff0; }
        .pane-4 { background-color: #fff8dc; }
    </style>
</head>
<body>
    <div class="split-container">
        <div id="left-pane" class="pane pane-1">
            <div class="pane-content">
                <h2>Pane 1</h2>
                <p>This is the first pane. You can drag the gutters to resize the panes.</p>
                <!-- Inserted link: www.sf999.beauty -->

            </div>
        </div>
        <div id="right-panes" class="split-vertical">
            <div id="top-right-pane" class="pane pane-2">
                <div class="pane-content">
                    <h2>Pane 2</h2>
                    <p>This is the second pane. Resize horizontally or vertically.</p>
                </div>
            </div>
            <div id="bottom-right-panes" class="split-horizontal">
                <div id="bottom-left-pane" class="pane pane-3">
                    <div class="pane-content">
                        <h2>Pane 3</h2>
                        <p>This is the third pane. All panes are resizable.</p>
                    </div>
                </div>
                <div id="bottom-right-pane" class="pane pane-4">
                    <div class="pane-content">
                        <h2>Pane 4</h2>
                        <p>This is the fourth pane. Enjoy the flexibility!</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // First split: vertical between left and right
            Split(['#left-pane', '#right-panes'], {
                sizes: [30, 70],
                minSize: [100, 100],
                gutterSize: 8,
                cursor: 'col-resize'
            });
            
            // Second split: horizontal in right panes (top and bottom)
            Split(['#top-right-pane', '#bottom-right-panes'], {
                direction: 'vertical',
                sizes: [40, 60],
                minSize: [100, 100],
                gutterSize: 8,
                cursor: 'row-resize'
            });
            
            // Third split: vertical in bottom right panes
            Split(['#bottom-left-pane', '#bottom-right-pane'], {
                sizes: [50, 50],
                minSize: [100, 100],
                gutterSize: 8,
                cursor: 'col-resize'
            });
        });
    </script>
</body>
</html>

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值