천

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

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

<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-30 조회 2,927
16-05-11 조회 3,449
16-03-21 조회 3,208
16-03-19 조회 3,143
16-03-17 조회 2,980
16-03-17 조회 3,041
16-03-14 조회 3,060
16-03-13 조회 2,989
16-03-09 조회 3,444
16-03-08 조회 3,065
16-03-08 조회 2,873
16-03-08 조회 2,893
16-03-08 조회 3,043
16-03-07 조회 2,831
16-03-07 조회 2,819
16-02-29 조회 3,230
16-02-25 조회 3,212
16-02-22 조회 3,015
16-02-12 조회 3,310
16-02-04 조회 3,138
16-02-04 조회 3,415
16-02-04 조회 3,048
16-02-03 조회 3,205
16-02-03 조회 3,025
16-02-02 조회 2,972
16-02-02 조회 2,861
16-02-01 조회 2,865
16-01-30 조회 2,693
16-01-30 조회 2,879
16-01-30 조회 2,995
16-01-30 조회 2,812
16-01-29 조회 2,678
16-01-28 조회 3,008
16-01-28 조회 2,877
16-01-27 조회 2,580
16-01-26 조회 2,557
16-01-26 조회 2,818
16-01-25 조회 2,609
16-01-22 조회 2,598
16-01-22 조회 2,674
16-01-21 조회 2,587
16-01-19 조회 2,503
16-01-19 조회 2,538
16-01-18 조회 2,523
16-01-17 조회 2,691
16-01-14 조회 2,618
16-01-13 조회 2,810
16-01-12 조회 2,916
16-01-12 조회 2,656
16-01-11 조회 2,670
15-12-30 조회 3,246
15-12-29 조회 2,616
15-12-28 조회 2,648
15-12-09 조회 2,710
15-12-08 조회 2,919
15-12-08 조회 2,671
15-12-08 조회 2,946
15-12-07 조회 2,744
15-12-07 조회 3,146
15-12-07 조회 2,770
15-12-06 조회 2,897
15-12-06 조회 2,611
15-12-06 조회 2,926
15-12-05 조회 2,777
15-12-05 조회 3,048
15-12-05 조회 2,800
15-12-04 조회 2,664
15-12-04 조회 2,776
15-12-04 조회 2,829
15-12-03 조회 2,779
15-12-03 조회 2,811
15-12-03 조회 2,848
15-12-02 조회 2,942
15-12-02 조회 2,866
15-12-02 조회 3,035
15-12-02 조회 3,176
15-12-01 조회 2,752
15-12-01 조회 2,548
15-12-01 조회 2,626
15-11-30 조회 2,811
15-11-30 조회 2,989
15-11-30 조회 2,871
15-11-29 조회 2,641
15-11-29 조회 2,894
15-11-29 조회 2,698
15-11-28 조회 2,635
15-11-28 조회 2,666
15-11-28 조회 2,700
15-11-27 조회 2,788
15-11-27 조회 2,645
15-11-27 조회 2,653
15-11-25 조회 2,747
15-11-25 조회 2,804
15-11-25 조회 2,593
15-11-23 조회 2,875
15-11-23 조회 3,020
15-11-23 조회 2,838
15-11-21 조회 2,739
15-11-21 조회 2,625
15-11-21 조회 2,570