천

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

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

<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-06-11 조회 3,004
16-02-15 조회 3,266
16-02-02 조회 2,932
16-01-25 조회 2,552
16-01-18 조회 2,642
16-01-08 조회 2,572
16-01-07 조회 2,585
16-01-05 조회 2,623
16-01-05 조회 2,919
16-01-05 조회 2,738
16-01-05 조회 2,777
16-01-04 조회 2,630
16-01-04 조회 2,644
16-01-04 조회 2,597
16-01-04 조회 2,507
15-12-30 조회 2,850
15-12-24 조회 2,667
15-12-24 조회 2,670
15-12-24 조회 2,693
15-12-24 조회 2,646
15-12-23 조회 2,630
15-12-16 조회 2,720
15-12-15 조회 2,791
15-12-11 조회 2,915
15-12-10 조회 2,772
15-11-09 조회 2,762
15-11-09 조회 2,990
15-10-06 조회 3,315
15-10-02 조회 3,103
15-05-29 조회 4,432
15-02-02 조회 4,415
15-01-18 조회 4,377
14-10-25 조회 8,342
14-10-25 조회 5,124
14-10-22 조회 7,130
14-10-22 조회 4,837
14-10-22 조회 4,787
14-10-18 조회 5,661
14-10-17 조회 6,033
14-10-17 조회 5,403
14-10-17 조회 8,846
14-10-17 조회 6,420
14-10-13 조회 4,338
14-10-13 조회 4,434
14-10-07 조회 6,130
14-09-24 조회 3,889
14-09-23 조회 3,963
14-09-22 조회 4,857
14-09-22 조회 6,080
14-09-22 조회 4,052
14-09-22 조회 3,736
14-09-21 조회 4,327
14-09-21 조회 3,799
14-09-20 조회 3,807
14-09-20 조회 3,710
14-09-20 조회 3,894
14-09-19 조회 3,834
14-09-19 조회 3,983
14-09-19 조회 3,872
14-09-19 조회 4,277
14-09-19 조회 3,882
14-09-19 조회 3,807
14-09-19 조회 4,103
14-09-19 조회 3,850
14-09-19 조회 3,894
14-09-19 조회 3,874
14-09-18 조회 3,956
14-09-18 조회 3,911
14-09-18 조회 4,182
14-09-18 조회 4,141
14-09-18 조회 4,161
14-09-18 조회 4,860
14-09-18 조회 5,409
14-09-18 조회 5,297
14-09-18 조회 4,094
14-09-18 조회 4,594
14-09-18 조회 4,221
14-08-30 조회 5,387
14-08-06 조회 5,972
14-08-06 조회 5,578
14-08-03 조회 5,231
14-06-12 조회 5,510
14-05-11 조회 3,685
14-05-11 조회 4,447
14-05-11 조회 4,554
14-05-09 조회 1.3만
14-05-01 조회 5,067
14-03-30 조회 4,369
14-03-23 조회 7,979
14-02-12 조회 3,867
13-10-29 조회 7,832
13-10-28 조회 8,651
13-09-29 조회 6,624
13-09-29 조회 4,249
13-07-23 조회 5,101
13-07-23 조회 1.2만
13-07-14 조회 4,662
13-07-14 조회 5,044
13-07-14 조회 5,990
13-07-14 조회 5,293