[스크립트] 이미지 없는 둥글게 테두리 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에서 이동 됨]
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1630 | 18년 전 | 2372 | ||
| 1629 | 18년 전 | 2842 | ||
| 1628 |
인스웨이브시스템즈
|
18년 전 | 4619 | |
| 1627 | 18년 전 | 2686 | ||
| 1626 |
silence
|
18년 전 | 1879 | |
| 1625 |
|
18년 전 | 3326 | |
| 1624 | 18년 전 | 3146 | ||
| 1623 | 18년 전 | 3871 | ||
| 1622 | 18년 전 | 2181 | ||
| 1621 | 18년 전 | 2362 | ||
| 1620 | 18년 전 | 10019 | ||
| 1619 | 18년 전 | 3515 | ||
| 1618 | 18년 전 | 3316 | ||
| 1617 | 18년 전 | 3195 | ||
| 1616 |
|
18년 전 | 2806 | |
| 1615 | 18년 전 | 4168 | ||
| 1614 |
에스카르고
|
18년 전 | 5512 | |
| 1613 | 18년 전 | 3751 | ||
| 1612 | 18년 전 | 3203 | ||
| 1611 | 18년 전 | 3612 | ||
| 1610 |
DHenny
|
18년 전 | 2269 | |
| 1609 | 18년 전 | 2697 | ||
| 1608 |
|
18년 전 | 3930 | |
| 1607 | 18년 전 | 2860 | ||
| 1606 |
|
18년 전 | 4374 | |
| 1605 | 18년 전 | 2090 | ||
| 1604 |
|
18년 전 | 2536 | |
| 1603 |
|
18년 전 | 2425 | |
| 1602 |
|
18년 전 | 3785 | |
| 1601 |
|
18년 전 | 3851 | |
| 1600 | 18년 전 | 2583 | ||
| 1599 | 18년 전 | 2655 | ||
| 1598 | 18년 전 | 2989 | ||
| 1597 |
|
18년 전 | 2812 | |
| 1596 |
|
18년 전 | 2020 | |
| 1595 |
|
18년 전 | 2186 | |
| 1594 | 18년 전 | 4837 | ||
| 1593 | 18년 전 | 4180 | ||
| 1592 | 18년 전 | 2807 | ||
| 1591 | 18년 전 | 2367 | ||
| 1590 | 18년 전 | 2879 | ||
| 1589 | 18년 전 | 2345 | ||
| 1588 |
|
18년 전 | 3515 | |
| 1587 | 18년 전 | 2176 | ||
| 1586 | 18년 전 | 1975 | ||
| 1585 | 18년 전 | 1828 | ||
| 1584 | 18년 전 | 1648 | ||
| 1583 | 18년 전 | 3244 | ||
| 1582 | 18년 전 | 4561 | ||
| 1581 | 18년 전 | 4842 | ||
| 1580 |
|
18년 전 | 2133 | |
| 1579 | 18년 전 | 3584 | ||
| 1578 | 18년 전 | 3313 | ||
| 1577 | 18년 전 | 4610 | ||
| 1576 | 18년 전 | 3241 | ||
| 1575 | 18년 전 | 4245 | ||
| 1574 |
개발전문가
|
18년 전 | 3939 | |
| 1573 |
mixdesign
|
18년 전 | 3646 | |
| 1572 |
mixdesign
|
18년 전 | 3025 | |
| 1571 |
mixdesign
|
18년 전 | 2910 | |
| 1570 | 18년 전 | 3488 | ||
| 1569 |
mixdesign
|
18년 전 | 2142 | |
| 1568 |
mixdesign
|
18년 전 | 2107 | |
| 1567 | 18년 전 | 5513 | ||
| 1566 |
mixdesign
|
18년 전 | 2690 | |
| 1565 |
mixdesign
|
18년 전 | 2446 | |
| 1564 | 18년 전 | 2749 | ||
| 1563 | 18년 전 | 2083 | ||
| 1562 | 18년 전 | 3086 | ||
| 1561 | 18년 전 | 10036 | ||
| 1560 |
행복속네잎크로버
|
18년 전 | 1928 | |
| 1559 | 18년 전 | 2837 | ||
| 1558 |
1111111
|
18년 전 | 2877 | |
| 1557 |
1111111
|
18년 전 | 2130 | |
| 1556 |
1111111
|
18년 전 | 2977 | |
| 1555 |
1111111
|
18년 전 | 3983 | |
| 1554 |
1111111
|
18년 전 | 2928 | |
| 1553 |
1111111
|
18년 전 | 2303 | |
| 1552 |
1111111
|
18년 전 | 6024 | |
| 1551 |
1111111
|
18년 전 | 3653 | |
| 1550 |
1111111
|
18년 전 | 6325 | |
| 1549 |
1111111
|
18년 전 | 2416 | |
| 1548 |
1111111
|
18년 전 | 2349 | |
| 1547 |
1111111
|
18년 전 | 2381 | |
| 1546 |
1111111
|
18년 전 | 3320 | |
| 1545 |
1111111
|
18년 전 | 3176 | |
| 1544 |
1111111
|
18년 전 | 1960 | |
| 1543 |
1111111
|
18년 전 | 3693 | |
| 1542 |
1111111
|
18년 전 | 1610 | |
| 1541 |
1111111
|
18년 전 | 1354 | |
| 1540 |
1111111
|
18년 전 | 1380 | |
| 1539 |
1111111
|
18년 전 | 1535 | |
| 1538 |
1111111
|
18년 전 | 1628 | |
| 1537 |
스카이부아
|
18년 전 | 3421 | |
| 1536 |
1111111
|
18년 전 | 2251 | |
| 1535 |
1111111
|
18년 전 | 1716 | |
| 1534 |
1111111
|
18년 전 | 2101 | |
| 1533 |
1111111
|
18년 전 | 4598 | |
| 1532 |
1111111
|
18년 전 | 2335 | |
| 1531 |
1111111
|
18년 전 | 2985 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기