[스크립트] 이미지 없는 둥글게 테두리 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년 전 | 1996 | |
| 1229 |
|
18년 전 | 2931 | |
| 1228 |
|
18년 전 | 2624 | |
| 1227 | 18년 전 | 2919 | ||
| 1226 | 18년 전 | 2355 | ||
| 1225 |
|
18년 전 | 2425 | |
| 1224 | 18년 전 | 2735 | ||
| 1223 |
|
18년 전 | 3982 | |
| 1222 |
mixdesign
|
18년 전 | 2626 | |
| 1221 |
|
18년 전 | 2743 | |
| 1220 | 18년 전 | 3202 | ||
| 1219 | 18년 전 | 2905 | ||
| 1218 | 18년 전 | 2096 | ||
| 1217 |
|
18년 전 | 2541 | |
| 1216 | 18년 전 | 2552 | ||
| 1215 |
mixdesign
|
18년 전 | 4034 | |
| 1214 |
|
18년 전 | 4783 | |
| 1213 | 18년 전 | 2315 | ||
| 1212 |
mixdesign
|
18년 전 | 2484 | |
| 1211 |
|
18년 전 | 2421 | |
| 1210 | 18년 전 | 3755 | ||
| 1209 |
mixdesign
|
18년 전 | 2372 | |
| 1208 |
mixdesign
|
18년 전 | 2374 | |
| 1207 |
mixdesign
|
18년 전 | 1718 | |
| 1206 |
mixdesign
|
18년 전 | 1999 | |
| 1205 |
mixdesign
|
18년 전 | 2698 | |
| 1204 |
mixdesign
|
18년 전 | 3576 | |
| 1203 | 18년 전 | 3089 | ||
| 1202 | 18년 전 | 2967 | ||
| 1201 | 18년 전 | 2029 | ||
| 1200 | 18년 전 | 4121 | ||
| 1199 | 18년 전 | 2158 | ||
| 1198 | 18년 전 | 4192 | ||
| 1197 | 18년 전 | 2501 | ||
| 1196 | 18년 전 | 2352 | ||
| 1195 |
|
18년 전 | 3461 | |
| 1194 | 18년 전 | 2234 | ||
| 1193 | 18년 전 | 2142 | ||
| 1192 | 18년 전 | 3271 | ||
| 1191 | 18년 전 | 3949 | ||
| 1190 | 18년 전 | 2206 | ||
| 1189 |
|
18년 전 | 2348 | |
| 1188 |
|
18년 전 | 3823 | |
| 1187 | 18년 전 | 2704 | ||
| 1186 | 18년 전 | 3349 | ||
| 1185 | 18년 전 | 2772 | ||
| 1184 | 18년 전 | 1661 | ||
| 1183 | 18년 전 | 2120 | ||
| 1182 | 18년 전 | 3688 | ||
| 1181 |
mermaid
|
18년 전 | 2916 | |
| 1180 | 18년 전 | 2968 | ||
| 1179 | 18년 전 | 3604 | ||
| 1178 | 18년 전 | 2165 | ||
| 1177 |
|
18년 전 | 2280 | |
| 1176 | 18년 전 | 3170 | ||
| 1175 | 18년 전 | 1853 | ||
| 1174 |
|
18년 전 | 2218 | |
| 1173 |
|
18년 전 | 2522 | |
| 1172 | 18년 전 | 1763 | ||
| 1171 | 18년 전 | 2101 | ||
| 1170 | 18년 전 | 1987 | ||
| 1169 | 18년 전 | 2503 | ||
| 1168 | 18년 전 | 1920 | ||
| 1167 | 18년 전 | 1716 | ||
| 1166 | 18년 전 | 1742 | ||
| 1165 | 18년 전 | 1725 | ||
| 1164 | 18년 전 | 2767 | ||
| 1163 | 18년 전 | 1552 | ||
| 1162 |
|
18년 전 | 5665 | |
| 1161 |
이걸~어쩌나~
|
18년 전 | 2392 | |
| 1160 | 18년 전 | 1659 | ||
| 1159 | 18년 전 | 4701 | ||
| 1158 | 18년 전 | 2050 | ||
| 1157 | 18년 전 | 4839 | ||
| 1156 | 18년 전 | 3188 | ||
| 1155 | 18년 전 | 2126 | ||
| 1154 | 18년 전 | 1826 | ||
| 1153 |
BEST79
|
18년 전 | 2100 | |
| 1152 | 18년 전 | 1721 | ||
| 1151 | 18년 전 | 1834 | ||
| 1150 | 18년 전 | 1836 | ||
| 1149 |
inniskun
|
18년 전 | 2475 | |
| 1148 |
|
18년 전 | 3492 | |
| 1147 |
|
18년 전 | 5972 | |
| 1146 |
|
18년 전 | 3862 | |
| 1145 | 18년 전 | 3056 | ||
| 1144 | 18년 전 | 2131 | ||
| 1143 | 18년 전 | 2398 | ||
| 1142 | 18년 전 | 2187 | ||
| 1141 |
|
18년 전 | 2297 | |
| 1140 | 18년 전 | 2404 | ||
| 1139 | 18년 전 | 2842 | ||
| 1138 | 18년 전 | 2535 | ||
| 1137 | 18년 전 | 1989 | ||
| 1136 | 18년 전 | 3125 | ||
| 1135 | 18년 전 | 3585 | ||
| 1134 | 18년 전 | 3829 | ||
| 1133 |
자반고등어
|
18년 전 | 3333 | |
| 1132 | 18년 전 | 3382 | ||
| 1131 | 18년 전 | 2562 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기