GNUI Start your next web project with GNUI.
Gn.util

Splitter

/scss/layout/splitter.scss
v.0.1.0 javascript

생성 옵션

HORIZONTAL TOP PANEL
VERTICAL LEFT PANEL
VERTICAL RIGHT PANEL
  <div id="horizontal-splitter" style="height: 300px">
    <div id="frame1">
      HORIZONTAL TOP PANEL
    </div>
    <div id="frame2">
      <div id="vertical-splitter" style="height: 100%">
        <div id="frame3">
          VERTICAL LEFT PANEL
        </div>
        <div id="frame4">
          VERTICAL RIGHT PANEL
        </div>
      </div>
    </div>
  </div>
  Gn.create('splitter', {
    target: '#horizontal-splitter',
    panel: ['#frame1','#frame2'],
    position: '30%',
    onDrag: function(e) {
      console.log('dragging');
    },
    onDragStart: function(e) {
      console.log('drag start');
    },
    onDragEnd: function(e) {
      console.log('drag End');
    }
  });
  Gn.create('splitter', {
    target: '#vertical-splitter',
    panel: ['#frame3','#frame4'],
    space: 20,
    orientation: 'vertical'
  });
name type default description
target string 화면 분할 객체 선택자(selector)
orientation string horizontal 화면분할 방향 (vertical | horizontal)
space number 0 패널영역 여백(padding)
minPosition number 30 축소 시 최소 사이즈 (space가 존재하는 경우 합산하여 적용됨)
position number, string 50% 생성 시 분할 핸들의 위치
panel array(2) [ 'selector','selector' ] 분할된 컨텐츠 객체 선택자(selector)
onDrag function 핸들 드래그 이벤트
onDragStart function 핸들 드래그 시작 이벤트
onDragEnd function 핸들 드래그 종료 이벤트