[스크립트] 이미지 없는 둥글게 테두리 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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1230 |
|
18년 전 | 2019 | |
| 1229 |
|
18년 전 | 2956 | |
| 1228 |
|
18년 전 | 2642 | |
| 1227 | 18년 전 | 2941 | ||
| 1226 | 18년 전 | 2370 | ||
| 1225 |
|
18년 전 | 2442 | |
| 1224 | 18년 전 | 2753 | ||
| 1223 |
|
18년 전 | 4000 | |
| 1222 |
mixdesign
|
18년 전 | 2639 | |
| 1221 |
|
18년 전 | 2762 | |
| 1220 | 18년 전 | 3218 | ||
| 1219 | 18년 전 | 2927 | ||
| 1218 | 18년 전 | 2123 | ||
| 1217 |
|
18년 전 | 2566 | |
| 1216 | 18년 전 | 2584 | ||
| 1215 |
mixdesign
|
18년 전 | 4070 | |
| 1214 |
|
18년 전 | 4797 | |
| 1213 | 18년 전 | 2331 | ||
| 1212 |
mixdesign
|
18년 전 | 2510 | |
| 1211 |
|
18년 전 | 2437 | |
| 1210 | 18년 전 | 3765 | ||
| 1209 |
mixdesign
|
18년 전 | 2383 | |
| 1208 |
mixdesign
|
18년 전 | 2384 | |
| 1207 |
mixdesign
|
18년 전 | 1735 | |
| 1206 |
mixdesign
|
18년 전 | 2014 | |
| 1205 |
mixdesign
|
18년 전 | 2712 | |
| 1204 |
mixdesign
|
18년 전 | 3585 | |
| 1203 | 18년 전 | 3106 | ||
| 1202 | 18년 전 | 2990 | ||
| 1201 | 18년 전 | 2038 | ||
| 1200 | 18년 전 | 4136 | ||
| 1199 | 18년 전 | 2180 | ||
| 1198 | 18년 전 | 4201 | ||
| 1197 | 18년 전 | 2515 | ||
| 1196 | 18년 전 | 2374 | ||
| 1195 |
|
18년 전 | 3481 | |
| 1194 | 18년 전 | 2252 | ||
| 1193 | 18년 전 | 2158 | ||
| 1192 | 18년 전 | 3278 | ||
| 1191 | 18년 전 | 3970 | ||
| 1190 | 18년 전 | 2232 | ||
| 1189 |
|
18년 전 | 2376 | |
| 1188 |
|
18년 전 | 3841 | |
| 1187 | 18년 전 | 2724 | ||
| 1186 | 18년 전 | 3390 | ||
| 1185 | 18년 전 | 2797 | ||
| 1184 | 18년 전 | 1678 | ||
| 1183 | 18년 전 | 2148 | ||
| 1182 | 18년 전 | 3715 | ||
| 1181 |
mermaid
|
18년 전 | 2931 | |
| 1180 | 18년 전 | 2989 | ||
| 1179 | 18년 전 | 3616 | ||
| 1178 | 18년 전 | 2183 | ||
| 1177 |
|
18년 전 | 2296 | |
| 1176 | 18년 전 | 3187 | ||
| 1175 | 18년 전 | 1889 | ||
| 1174 |
|
18년 전 | 2243 | |
| 1173 |
|
18년 전 | 2532 | |
| 1172 | 18년 전 | 1781 | ||
| 1171 | 18년 전 | 2116 | ||
| 1170 | 18년 전 | 2000 | ||
| 1169 | 18년 전 | 2515 | ||
| 1168 | 18년 전 | 1941 | ||
| 1167 | 18년 전 | 1732 | ||
| 1166 | 18년 전 | 1756 | ||
| 1165 | 18년 전 | 1736 | ||
| 1164 | 18년 전 | 2805 | ||
| 1163 | 18년 전 | 1565 | ||
| 1162 |
|
18년 전 | 5685 | |
| 1161 |
이걸~어쩌나~
|
18년 전 | 2417 | |
| 1160 | 18년 전 | 1676 | ||
| 1159 | 18년 전 | 4708 | ||
| 1158 | 18년 전 | 2059 | ||
| 1157 | 18년 전 | 4848 | ||
| 1156 | 18년 전 | 3197 | ||
| 1155 | 18년 전 | 2140 | ||
| 1154 | 18년 전 | 1839 | ||
| 1153 |
BEST79
|
18년 전 | 2119 | |
| 1152 | 18년 전 | 1740 | ||
| 1151 | 18년 전 | 1850 | ||
| 1150 | 18년 전 | 1853 | ||
| 1149 |
inniskun
|
18년 전 | 2489 | |
| 1148 |
|
18년 전 | 3511 | |
| 1147 |
|
18년 전 | 5982 | |
| 1146 |
|
18년 전 | 3874 | |
| 1145 | 18년 전 | 3066 | ||
| 1144 | 18년 전 | 2154 | ||
| 1143 | 18년 전 | 2426 | ||
| 1142 | 18년 전 | 2214 | ||
| 1141 |
|
18년 전 | 2316 | |
| 1140 | 18년 전 | 2422 | ||
| 1139 | 18년 전 | 2852 | ||
| 1138 | 18년 전 | 2547 | ||
| 1137 | 18년 전 | 2004 | ||
| 1136 | 18년 전 | 3136 | ||
| 1135 | 18년 전 | 3600 | ||
| 1134 | 18년 전 | 3845 | ||
| 1133 |
자반고등어
|
18년 전 | 3352 | |
| 1132 | 18년 전 | 3401 | ||
| 1131 | 18년 전 | 2581 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기