[스크립트] 이미지 없는 둥글게 테두리 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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1330 | 18년 전 | 1486 | ||
| 1329 | 18년 전 | 1717 | ||
| 1328 | 18년 전 | 998 | ||
| 1327 | 18년 전 | 1411 | ||
| 1326 | 18년 전 | 2256 | ||
| 1325 | 18년 전 | 1142 | ||
| 1324 | 18년 전 | 1303 | ||
| 1323 | 18년 전 | 1566 | ||
| 1322 | 18년 전 | 1176 | ||
| 1321 | 18년 전 | 966 | ||
| 1320 | 18년 전 | 1191 | ||
| 1319 | 18년 전 | 1521 | ||
| 1318 | 18년 전 | 1648 | ||
| 1317 | 18년 전 | 1600 | ||
| 1316 | 18년 전 | 1210 | ||
| 1315 |
|
18년 전 | 8601 | |
| 1314 | 18년 전 | 1908 | ||
| 1313 | 18년 전 | 1495 | ||
| 1312 | 18년 전 | 1485 | ||
| 1311 | 18년 전 | 1780 | ||
| 1310 | 18년 전 | 1832 | ||
| 1309 | 18년 전 | 1220 | ||
| 1308 | 18년 전 | 984 | ||
| 1307 | 18년 전 | 2758 | ||
| 1306 | 18년 전 | 3108 | ||
| 1305 | 18년 전 | 2167 | ||
| 1304 | 18년 전 | 1556 | ||
| 1303 | 18년 전 | 1418 | ||
| 1302 | 18년 전 | 881 | ||
| 1301 | 18년 전 | 1774 | ||
| 1300 | 18년 전 | 5137 | ||
| 1299 | 18년 전 | 2854 | ||
| 1298 |
mixdesign
|
18년 전 | 2106 | |
| 1297 | 18년 전 | 3078 | ||
| 1296 | 18년 전 | 2543 | ||
| 1295 | 18년 전 | 2238 | ||
| 1294 |
onweb
|
18년 전 | 4560 | |
| 1293 |
onweb
|
18년 전 | 3491 | |
| 1292 | 18년 전 | 3455 | ||
| 1291 | 18년 전 | 4038 | ||
| 1290 | 18년 전 | 1905 | ||
| 1289 | 18년 전 | 1758 | ||
| 1288 | 18년 전 | 1727 | ||
| 1287 | 18년 전 | 1427 | ||
| 1286 | 18년 전 | 1264 | ||
| 1285 | 18년 전 | 1156 | ||
| 1284 | 18년 전 | 1159 | ||
| 1283 | 18년 전 | 1512 | ||
| 1282 | 18년 전 | 913 | ||
| 1281 | 18년 전 | 1270 | ||
| 1280 | 18년 전 | 1128 | ||
| 1279 | 18년 전 | 1147 | ||
| 1278 | 18년 전 | 3026 | ||
| 1277 | 18년 전 | 947 | ||
| 1276 | 18년 전 | 1155 | ||
| 1275 | 18년 전 | 2095 | ||
| 1274 | 18년 전 | 2225 | ||
| 1273 | 18년 전 | 1321 | ||
| 1272 | 18년 전 | 1908 | ||
| 1271 | 18년 전 | 1161 | ||
| 1270 | 18년 전 | 2497 | ||
| 1269 | 18년 전 | 6596 | ||
| 1268 |
페이지팩트
|
18년 전 | 3820 | |
| 1267 |
페이지팩트
|
18년 전 | 2227 | |
| 1266 |
|
18년 전 | 6294 | |
| 1265 | 18년 전 | 2574 | ||
| 1264 | 18년 전 | 2619 | ||
| 1263 | 18년 전 | 2122 | ||
| 1262 | 18년 전 | 2117 | ||
| 1261 |
페이지팩트
|
18년 전 | 2123 | |
| 1260 | 18년 전 | 3886 | ||
| 1259 |
|
18년 전 | 3935 | |
| 1258 |
|
18년 전 | 5037 | |
| 1257 | 18년 전 | 4134 | ||
| 1256 | 18년 전 | 2574 | ||
| 1255 | 18년 전 | 1808 | ||
| 1254 | 18년 전 | 2781 | ||
| 1253 | 18년 전 | 2716 | ||
| 1252 | 18년 전 | 2237 | ||
| 1251 | 18년 전 | 5415 | ||
| 1250 |
jbsstyle
|
18년 전 | 4761 | |
| 1249 |
|
18년 전 | 3769 | |
| 1248 | 18년 전 | 3452 | ||
| 1247 | 18년 전 | 2139 | ||
| 1246 | 18년 전 | 2136 | ||
| 1245 | 18년 전 | 3639 | ||
| 1244 |
|
18년 전 | 2279 | |
| 1243 |
|
18년 전 | 2494 | |
| 1242 | 18년 전 | 1765 | ||
| 1241 | 18년 전 | 4464 | ||
| 1240 | 18년 전 | 2153 | ||
| 1239 | 18년 전 | 2301 | ||
| 1238 | 18년 전 | 4039 | ||
| 1237 |
hwatta
|
18년 전 | 3892 | |
| 1236 | 18년 전 | 2117 | ||
| 1235 | 18년 전 | 2767 | ||
| 1234 | 18년 전 | 5144 | ||
| 1233 | 18년 전 | 2407 | ||
| 1232 |
|
18년 전 | 2950 | |
| 1231 | 18년 전 | 8501 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기