천

이미지 없이 라운딩 박스 + 보더 표현하기 입니다.

· 2015-12-22 (화) 03:24:26 · 2670

<script>

function round(elm, bgcolor, border, mode) {
  var top = document.createElement('div'); top.style.cssText = 'height:5px';
  var bottom = document.createElement('div');bottom.style.cssText = 'height:5px';
  var temp = document.createElement('div'); temp.setAttribute('id', 'template');
  var border2 = (border) ? ";border-left:2px solid "+border+";border-right:2px solid "+border : "";
  var border1 = (border) ? ";border-left:1px solid "+border+";border-right:1px solid "+border : "";
  var bgcolor2 = (bgcolor) ? ";background:"+bgcolor : "";
  var bgcolor1 = (border) ? ";background:" + border : (bgcolor) ? ";background:" + bgcolor : "";

  var top_r = new Array(), bottom_r =new Array;
  var box = elm.cloneNode(true)
  for (i=1; i < 5 ;i++ )
  { top_r[i] = document.createElement('div')}

  top_r[1].style.cssText = 'margin:0px 5px;height:1px' + bgcolor1 ;
  top_r[2].style.cssText = 'margin:0px 3px;height:1px' + border2 + bgcolor2;
  top_r[3].style.cssText = 'margin:0px 2px;height:1px' + border1 + bgcolor2;
  top_r[4].style.cssText = 'margin:0px 1px;height:2px' + border1 + bgcolor2;

 
  for (i=1; i < 5 ;i++ ) {
    if (mode!='bottom') { top.appendChild(top_r[i]);temp.appendChild(top); }
    bottom_r[i] = top_r[i].cloneNode(true);
  }

  temp.appendChild(box);
  box.style.cssText =  border1 + bgcolor2;
  temp.appendChild(bottom);

  if (mode!='top') {
    for (i=4; i > 0 ;i-- ) {
      bottom.appendChild(bottom_r[i]);
    }
  }

  elm.parentNode.replaceChild(temp, elm);

}

</script>

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-07-13 조회 2,169
16-07-12 조회 2,347
16-07-12 조회 2,376
16-07-11 조회 2,192
16-06-05 조회 2,914
16-06-03 조회 3,032
16-05-26 조회 2,956
15-09-22 조회 4,988
15-06-10 조회 4,830
14-10-25 조회 6,356
14-10-22 조회 8,984
14-09-21 조회 5,788
14-09-16 조회 5,072
14-08-22 조회 1.1만
14-08-13 조회 5,903
14-08-12 조회 5,439
14-08-12 조회 6,299
14-08-11 조회 6,925
14-06-12 조회 6,200
14-06-11 조회 5,107
14-05-09 조회 5,420
14-05-09 조회 6,383
14-05-09 조회 6,412
14-05-08 조회 5,749
14-04-17 조회 4,746
14-04-16 조회 4,580
14-04-15 조회 4,585
14-04-15 조회 4,533
14-04-15 조회 4,304
14-04-14 조회 4,288
14-04-14 조회 4,257
14-04-14 조회 4,633
14-04-14 조회 4,778
14-04-14 조회 4,760
14-04-13 조회 4,665
14-04-12 조회 4,233
14-04-12 조회 4,374
14-04-12 조회 4,482
14-04-11 조회 5,007
14-04-10 조회 4,743
14-04-10 조회 4,778
14-04-09 조회 4,936
14-04-09 조회 5,304
14-04-08 조회 6,970
13-10-30 조회 7,652
13-07-11 조회 5,135
13-03-28 조회 1.1만
13-02-27 조회 6,786
13-02-14 조회 5,605
13-01-10 조회 4,522
12-12-31 조회 5,102
12-12-20 조회 6,118
12-12-12 조회 5,275
12-12-07 조회 4,498
12-11-28 조회 4,850
12-11-22 조회 5,290
12-11-12 조회 5,655
12-09-22 조회 4,511
12-09-18 조회 4,701