천

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

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

<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-05-11 조회 3,013
16-03-11 조회 2,816
16-03-09 조회 2,884
16-02-18 조회 2,993
16-01-28 조회 2,506
16-01-26 조회 2,473
16-01-22 조회 2,482
16-01-21 조회 2,499
16-01-14 조회 2,629
16-01-13 조회 2,482
16-01-12 조회 2,492
16-01-03 조회 3,253
16-01-03 조회 2,596
16-01-03 조회 2,788
16-01-02 조회 2,528
16-01-02 조회 2,643
16-01-02 조회 2,435
16-01-01 조회 2,724
16-01-01 조회 2,635
16-01-01 조회 2,653
15-12-31 조회 2,758
15-12-31 조회 2,795
15-12-31 조회 2,639
15-12-30 조회 2,666
15-12-30 조회 2,529
15-12-30 조회 2,509
15-12-29 조회 2,704
15-12-29 조회 2,805
15-12-29 조회 2,555
15-12-28 조회 2,584
15-12-28 조회 2,559
15-12-28 조회 2,463
15-11-26 조회 2,744
15-11-03 조회 3,322
15-11-02 조회 2,549
15-10-30 조회 3,178
15-10-30 조회 2,611
15-10-29 조회 2,673
15-10-03 조회 3,507
15-10-03 조회 2,759
15-10-02 조회 2,690
15-09-30 조회 2,583
15-09-30 조회 2,737
15-09-30 조회 2,809
15-09-30 조회 2,813
15-09-24 조회 2,772
15-09-24 조회 2,693
15-09-23 조회 3,071
15-09-23 조회 2,596
15-09-23 조회 2,675
15-09-23 조회 2,856
15-09-21 조회 2,598
15-09-21 조회 2,620
15-09-21 조회 2,684
15-07-02 조회 3,080
15-02-09 조회 4,577
15-01-24 조회 5,254
14-12-18 조회 5,280
14-11-21 조회 4,039
14-08-23 조회 3,798
14-08-11 조회 4,456
14-08-06 조회 6,038
14-08-01 조회 3,938
14-06-24 조회 5,754
14-05-18 조회 4,720
14-05-15 조회 4,515
14-05-15 조회 5,332
14-05-13 조회 4,741
14-05-09 조회 4,029
14-04-22 조회 4,515
14-04-16 조회 5,467
14-03-17 조회 7,226
13-11-12 조회 5,443
13-10-18 조회 4,414
13-10-15 조회 4,661
13-08-22 조회 4,587
13-08-18 조회 8,390
13-07-23 조회 7,205
13-07-23 조회 8,384
13-07-07 조회 5,348
13-05-18 조회 6,484
13-04-02 조회 6,029
13-04-02 조회 6,933
13-04-02 조회 7,273
13-04-02 조회 4,389
13-03-25 조회 3,933
13-03-20 조회 1.2만
13-02-12 조회 3,832
13-01-25 조회 4,614
13-01-17 조회 3,938
13-01-11 조회 4,166
13-01-01 조회 7,057
12-12-30 조회 5,944
12-12-17 조회 3,599
12-12-02 조회 7,277
12-11-29 조회 3,793
12-11-27 조회 4,810
12-10-05 조회 5,615
12-10-03 조회 4,505
12-09-14 조회 4,310