[스크립트] 이미지 없는 둥글게 테두리 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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1030 | 18년 전 | 1792 | ||
| 1029 | 18년 전 | 2228 | ||
| 1028 | 18년 전 | 2634 | ||
| 1027 | 18년 전 | 1800 | ||
| 1026 | 18년 전 | 1536 | ||
| 1025 | 18년 전 | 1545 | ||
| 1024 | 18년 전 | 1470 | ||
| 1023 | 18년 전 | 3231 | ||
| 1022 | 18년 전 | 2919 | ||
| 1021 | 18년 전 | 1680 | ||
| 1020 | 18년 전 | 3420 | ||
| 1019 | 18년 전 | 1846 | ||
| 1018 | 18년 전 | 1498 | ||
| 1017 | 18년 전 | 1964 | ||
| 1016 | 18년 전 | 2103 | ||
| 1015 | 18년 전 | 1642 | ||
| 1014 | 18년 전 | 2352 | ||
| 1013 | 18년 전 | 2008 | ||
| 1012 | 18년 전 | 1632 | ||
| 1011 | 18년 전 | 1788 | ||
| 1010 | 18년 전 | 2045 | ||
| 1009 | 18년 전 | 1809 | ||
| 1008 | 18년 전 | 1625 | ||
| 1007 | 18년 전 | 1670 | ||
| 1006 | 18년 전 | 3140 | ||
| 1005 | 18년 전 | 2007 | ||
| 1004 | 18년 전 | 1876 | ||
| 1003 | 18년 전 | 4372 | ||
| 1002 | 18년 전 | 4998 | ||
| 1001 | 18년 전 | 3168 | ||
| 1000 | 18년 전 | 2917 | ||
| 999 | 19년 전 | 3506 | ||
| 998 | 19년 전 | 2055 | ||
| 997 | 19년 전 | 2418 | ||
| 996 | 19년 전 | 2707 | ||
| 995 | 19년 전 | 2765 | ||
| 994 | 19년 전 | 2354 | ||
| 993 | 19년 전 | 1622 | ||
| 992 | 19년 전 | 3384 | ||
| 991 | 19년 전 | 1998 | ||
| 990 | 19년 전 | 2393 | ||
| 989 | 19년 전 | 2464 | ||
| 988 | 19년 전 | 2892 | ||
| 987 | 19년 전 | 5227 | ||
| 986 |
|
19년 전 | 2500 | |
| 985 |
|
19년 전 | 3351 | |
| 984 | 19년 전 | 4280 | ||
| 983 |
느낌좋은날
|
19년 전 | 2511 | |
| 982 | 19년 전 | 2475 | ||
| 981 | 19년 전 | 4044 | ||
| 980 | 19년 전 | 2753 | ||
| 979 |
Sinpre
|
19년 전 | 3004 | |
| 978 | 19년 전 | 2213 | ||
| 977 | 19년 전 | 2225 | ||
| 976 | 19년 전 | 1995 | ||
| 975 | 19년 전 | 3277 | ||
| 974 | 19년 전 | 2112 | ||
| 973 |
|
19년 전 | 2797 | |
| 972 |
|
19년 전 | 1750 | |
| 971 | 19년 전 | 5324 | ||
| 970 | 19년 전 | 3581 | ||
| 969 | 19년 전 | 4330 | ||
| 968 | 19년 전 | 3074 | ||
| 967 | 19년 전 | 2530 | ||
| 966 | 19년 전 | 3932 | ||
| 965 | 19년 전 | 2665 | ||
| 964 | 19년 전 | 3002 | ||
| 963 | 19년 전 | 2973 | ||
| 962 | 19년 전 | 4191 | ||
| 961 | 19년 전 | 3133 | ||
| 960 | 19년 전 | 3031 | ||
| 959 | 19년 전 | 3686 | ||
| 958 | 19년 전 | 2980 | ||
| 957 | 19년 전 | 2195 | ||
| 956 | 19년 전 | 2227 | ||
| 955 | 19년 전 | 2183 | ||
| 954 | 19년 전 | 2774 | ||
| 953 | 19년 전 | 2484 | ||
| 952 | 19년 전 | 3355 | ||
| 951 | 19년 전 | 3214 | ||
| 950 | 19년 전 | 1829 | ||
| 949 | 19년 전 | 2741 | ||
| 948 | 19년 전 | 7830 | ||
| 947 |
|
19년 전 | 2504 | |
| 946 |
DeepnBlue
|
19년 전 | 3118 | |
| 945 |
pearly
|
19년 전 | 2890 | |
| 944 | 19년 전 | 3032 | ||
| 943 |
|
19년 전 | 2238 | |
| 942 | 19년 전 | 2455 | ||
| 941 |
|
19년 전 | 4080 | |
| 940 | 19년 전 | 2235 | ||
| 939 |
|
19년 전 | 4222 | |
| 938 |
|
19년 전 | 2387 | |
| 937 | 19년 전 | 2087 | ||
| 936 |
|
19년 전 | 2333 | |
| 935 | 19년 전 | 1880 | ||
| 934 |
|
19년 전 | 2413 | |
| 933 | 19년 전 | 2207 | ||
| 932 |
|
19년 전 | 3078 | |
| 931 | 19년 전 | 1867 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기