[스크립트] 이미지 없는 둥글게 테두리 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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 95 | ||
| 8229 | 9년 전 | 94 | ||
| 8228 |
커네드커네드
|
9년 전 | 140 | |
| 8227 | 9년 전 | 163 | ||
| 8226 | 9년 전 | 187 | ||
| 8225 | 9년 전 | 174 | ||
| 8224 | 9년 전 | 166 | ||
| 8223 | 9년 전 | 139 | ||
| 8222 |
|
9년 전 | 213 | |
| 8221 | 9년 전 | 121 | ||
| 8220 | 9년 전 | 140 | ||
| 8219 | 9년 전 | 120 | ||
| 8218 | 9년 전 | 166 | ||
| 8217 |
star3840
|
9년 전 | 136 | |
| 8216 | 9년 전 | 186 | ||
| 8215 | 9년 전 | 140 | ||
| 8214 | 9년 전 | 248 | ||
| 8213 | 9년 전 | 194 | ||
| 8212 | 9년 전 | 111 | ||
| 8211 | 9년 전 | 277 | ||
| 8210 | 9년 전 | 279 | ||
| 8209 | 9년 전 | 361 | ||
| 8208 | 9년 전 | 252 | ||
| 8207 | 9년 전 | 250 | ||
| 8206 |
|
9년 전 | 217 | |
| 8205 | 9년 전 | 200 | ||
| 8204 | 9년 전 | 160 | ||
| 8203 | 9년 전 | 253 | ||
| 8202 | 9년 전 | 167 | ||
| 8201 | 9년 전 | 203 | ||
| 8200 | 9년 전 | 193 | ||
| 8199 | 9년 전 | 238 | ||
| 8198 | 9년 전 | 202 | ||
| 8197 | 9년 전 | 188 | ||
| 8196 | 9년 전 | 578 | ||
| 8195 | 9년 전 | 185 | ||
| 8194 | 9년 전 | 311 | ||
| 8193 | 9년 전 | 190 | ||
| 8192 | 9년 전 | 223 | ||
| 8191 | 9년 전 | 172 | ||
| 8190 | 9년 전 | 167 | ||
| 8189 | 9년 전 | 229 | ||
| 8188 | 9년 전 | 159 | ||
| 8187 | 9년 전 | 171 | ||
| 8186 | 9년 전 | 167 | ||
| 8185 | 9년 전 | 341 | ||
| 8184 | 9년 전 | 131 | ||
| 8183 | 9년 전 | 345 | ||
| 8182 | 9년 전 | 199 | ||
| 8181 | 9년 전 | 162 | ||
| 8180 | 9년 전 | 732 | ||
| 8179 | 9년 전 | 511 | ||
| 8178 | 9년 전 | 340 | ||
| 8177 |
kiplayer
|
9년 전 | 354 | |
| 8176 | 9년 전 | 387 | ||
| 8175 | 9년 전 | 254 | ||
| 8174 | 9년 전 | 273 | ||
| 8173 | 9년 전 | 366 | ||
| 8172 | 9년 전 | 230 | ||
| 8171 | 9년 전 | 204 | ||
| 8170 | 9년 전 | 322 | ||
| 8169 |
커네드커네드
|
9년 전 | 284 | |
| 8168 | 9년 전 | 351 | ||
| 8167 | 9년 전 | 344 | ||
| 8166 | 9년 전 | 264 | ||
| 8165 | 9년 전 | 196 | ||
| 8164 | 9년 전 | 332 | ||
| 8163 | 9년 전 | 311 | ||
| 8162 | 9년 전 | 332 | ||
| 8161 | 9년 전 | 323 | ||
| 8160 |
|
9년 전 | 521 | |
| 8159 | 9년 전 | 457 | ||
| 8158 | 9년 전 | 278 | ||
| 8157 | 9년 전 | 402 | ||
| 8156 | 9년 전 | 289 | ||
| 8155 | 9년 전 | 279 | ||
| 8154 |
00년생용띠
|
9년 전 | 626 | |
| 8153 | 9년 전 | 260 | ||
| 8152 |
|
9년 전 | 436 | |
| 8151 | 9년 전 | 443 | ||
| 8150 | 9년 전 | 536 | ||
| 8149 |
Jangfolk
|
9년 전 | 377 | |
| 8148 | 9년 전 | 202 | ||
| 8147 | 9년 전 | 410 | ||
| 8146 | 9년 전 | 473 | ||
| 8145 | 9년 전 | 428 | ||
| 8144 | 9년 전 | 389 | ||
| 8143 | 9년 전 | 223 | ||
| 8142 | 9년 전 | 461 | ||
| 8141 | 9년 전 | 410 | ||
| 8140 | 9년 전 | 954 | ||
| 8139 | 9년 전 | 299 | ||
| 8138 |
전갈자리남자
|
9년 전 | 415 | |
| 8137 | 9년 전 | 430 | ||
| 8136 | 9년 전 | 775 | ||
| 8135 |
|
9년 전 | 819 | |
| 8134 |
PlayPixel
|
9년 전 | 545 | |
| 8133 |
|
9년 전 | 469 | |
| 8132 | 9년 전 | 488 | ||
| 8131 | 9년 전 | 838 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기