[스크립트] 이미지 없는 둥글게 테두리 DIV
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>이미지 없이 라운딩 박스 + 보더 표현하기!</title>
<style>
* {font-size:12px;}
#test {padding:3px;}
</style>
</head>
<body>
<div id='test'>이미지 없이 라운딩 박스 + 보더 표현하기!</div>
<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>
<p>
<a href="#" onclick="round(document.getElementById('test'),'#f0f0f0','#c0c0c0')">배경+테두리</a> <br />
<a href="#" onclick="round(document.getElementById('test'),'#eeeeee')">배경만</a> <br />
<a href="javascript:window.location.reload()">원상태로</a> <br />
</p>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>이미지 없이 라운딩 박스 + 보더 표현하기!</title>
<style>
* {font-size:12px;}
#test {padding:3px;}
</style>
</head>
<body>
<div id='test'>이미지 없이 라운딩 박스 + 보더 표현하기!</div>
<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>
<p>
<a href="#" onclick="round(document.getElementById('test'),'#f0f0f0','#c0c0c0')">배경+테두리</a> <br />
<a href="#" onclick="round(document.getElementById('test'),'#eeeeee')">배경만</a> <br />
<a href="javascript:window.location.reload()">원상태로</a> <br />
</p>
</body>
</html>
[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 421 | ||
| 7929 | 9년 전 | 347 | ||
| 7928 | 9년 전 | 437 | ||
| 7927 | 9년 전 | 355 | ||
| 7926 | 9년 전 | 673 | ||
| 7925 | 9년 전 | 374 | ||
| 7924 | 9년 전 | 353 | ||
| 7923 | 9년 전 | 357 | ||
| 7922 | 9년 전 | 392 | ||
| 7921 | 9년 전 | 408 | ||
| 7920 | 9년 전 | 327 | ||
| 7919 | 9년 전 | 342 | ||
| 7918 | 9년 전 | 496 | ||
| 7917 | 9년 전 | 349 | ||
| 7916 | 9년 전 | 422 | ||
| 7915 | 9년 전 | 418 | ||
| 7914 | 9년 전 | 434 | ||
| 7913 | 9년 전 | 597 | ||
| 7912 | 9년 전 | 438 | ||
| 7911 | 9년 전 | 379 | ||
| 7910 | 9년 전 | 419 | ||
| 7909 | 9년 전 | 522 | ||
| 7908 | 9년 전 | 445 | ||
| 7907 | 9년 전 | 391 | ||
| 7906 | 9년 전 | 410 | ||
| 7905 | 9년 전 | 385 | ||
| 7904 | 9년 전 | 372 | ||
| 7903 | 9년 전 | 362 | ||
| 7902 | 9년 전 | 569 | ||
| 7901 |
|
9년 전 | 751 | |
| 7900 | 9년 전 | 608 | ||
| 7899 | 9년 전 | 405 | ||
| 7898 | 9년 전 | 404 | ||
| 7897 | 9년 전 | 364 | ||
| 7896 | 9년 전 | 371 | ||
| 7895 | 9년 전 | 482 | ||
| 7894 | 9년 전 | 408 | ||
| 7893 | 9년 전 | 363 | ||
| 7892 | 9년 전 | 411 | ||
| 7891 | 9년 전 | 780 | ||
| 7890 | 9년 전 | 1206 | ||
| 7889 | 9년 전 | 755 | ||
| 7888 |
limsy1987
|
9년 전 | 559 | |
| 7887 | 9년 전 | 573 | ||
| 7886 | 9년 전 | 466 | ||
| 7885 | 9년 전 | 428 | ||
| 7884 | 9년 전 | 428 | ||
| 7883 | 9년 전 | 425 | ||
| 7882 | 9년 전 | 478 | ||
| 7881 | 9년 전 | 458 | ||
| 7880 | 9년 전 | 593 | ||
| 7879 | 9년 전 | 479 | ||
| 7878 | 9년 전 | 1237 | ||
| 7877 | 9년 전 | 767 | ||
| 7876 | 9년 전 | 504 | ||
| 7875 | 9년 전 | 578 | ||
| 7874 |
|
9년 전 | 819 | |
| 7873 | 9년 전 | 530 | ||
| 7872 | 9년 전 | 691 | ||
| 7871 | 9년 전 | 495 | ||
| 7870 | 9년 전 | 625 | ||
| 7869 | 9년 전 | 442 | ||
| 7868 | 9년 전 | 469 | ||
| 7867 | 9년 전 | 452 | ||
| 7866 | 9년 전 | 513 | ||
| 7865 | 9년 전 | 464 | ||
| 7864 | 9년 전 | 531 | ||
| 7863 | 9년 전 | 526 | ||
| 7862 | 9년 전 | 478 | ||
| 7861 | 9년 전 | 660 | ||
| 7860 | 9년 전 | 635 | ||
| 7859 | 9년 전 | 425 | ||
| 7858 | 9년 전 | 714 | ||
| 7857 | 9년 전 | 1094 | ||
| 7856 | 9년 전 | 543 | ||
| 7855 | 9년 전 | 768 | ||
| 7854 | 9년 전 | 736 | ||
| 7853 | 9년 전 | 598 | ||
| 7852 | 9년 전 | 527 | ||
| 7851 | 9년 전 | 525 | ||
| 7850 | 9년 전 | 598 | ||
| 7849 | 9년 전 | 372 | ||
| 7848 | 9년 전 | 431 | ||
| 7847 | 9년 전 | 673 | ||
| 7846 | 9년 전 | 468 | ||
| 7845 | 9년 전 | 437 | ||
| 7844 | 9년 전 | 408 | ||
| 7843 | 9년 전 | 431 | ||
| 7842 | 9년 전 | 417 | ||
| 7841 | 9년 전 | 396 | ||
| 7840 | 9년 전 | 416 | ||
| 7839 | 9년 전 | 444 | ||
| 7838 | 9년 전 | 524 | ||
| 7837 | 9년 전 | 370 | ||
| 7836 | 9년 전 | 413 | ||
| 7835 | 9년 전 | 487 | ||
| 7834 |
|
9년 전 | 1201 | |
| 7833 | 9년 전 | 452 | ||
| 7832 | 9년 전 | 434 | ||
| 7831 | 9년 전 | 581 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기