<!--클래스-->
<script>
Layer = function() {
this.Elem = document.createElement('div');
this.Elem.id = 'Layer' + Layer.Count++;
this.Elem.appendChild(document.createElement('div'));
this.Elem.appendChild(document.createElement('div'));
// Properties
this.Id = this.Elem.id;
this.Drag = true;
this.Subject = 'Layer';
this.Content = 'Content';
this.Style = this.Elem.style;
this.SubjectStyle = this.Elem.children[0].style;
this.ContentStyle = this.Elem.children[1].style;
//
// Init
with(this.Style) {
position = 'absolute';
border = '1px solid slategray';
zIndex = Layer.ZIndex++;
}
with(this.SubjectStyle) {
font = 'bold 9pt tahoma';
backgroundColor = 'slategray';
color = 'lightgrey';
padding = '3px';
cursor = 'default';
}
with(this.ContentStyle) {
font = 'normal 9pt tahoma';
backgroundColor = 'whitesmoke';
color = 'slategray';
padding = '3px';
}
//
// Show Method
this.Show = function() {
document.body.appendChild(this.Elem);
this.Refresh();
}//
// Refresh Method
this.Refresh = function() {
this.Elem.children[1].innerHTML = this.Content;
with(this.Elem.children[0]) {
innerHTML = this.Subject;
onselectstart = function() { return false; }
style.width = Math.max(this.Elem.children[1].offsetWidth, offsetWidth);
ondblclick = function() {
with(this.parentElement.children[1].style) {
display = display ? '' : 'none';
}
}
// Drag Event
if(this.Drag) {
IsDrag = false;
var PadLeft = parseInt(style.paddingLeft);
var PadTop = parseInt(style.paddingTop);
onmousedown = function() {
IsDrag = true;
DragX = event.offsetX + PadLeft;
DragY = event.offsetY + PadTop;
}
onmouseup = function() { IsDrag = false; }
onmouseout = function() { IsDrag = false; }
onmousemove = function() {
if(IsDrag) {
with(this.parentElement.style) {
left = event.clientX - DragX;
top = event.clientY - DragY;
}
}
}
}
else {
IsDrag = DragX = DragY = null;
onmousedown = onmouseup = onmouseout = onmousemove = null;
}// End Drag Event
}
}// End Refresh()
// Event z-index
this.Elem.children[0].onclick = function() { this.parentElement.style.zIndex = Layer.ZIndex++; }
this.Elem.children[1].onclick = function() { this.parentElement.style.zIndex = Layer.ZIndex++; }
}
Layer.Count = 0;
Layer.ZIndex = 100;
</script>
<!---->
<!--사용-->
<script>
window.onload = function() {
with(document) {
with(body) {
Layer1 = new Layer();
Layer1.Subject = '드래그 ON 레이어';
Layer1.Content = '나 보기가 역겨워 가실때에는<br>' +
'말 없이 고이 보내 드리오리다.<br>' +
'<img src=http://mypds.mireene.com/g4/_v1/img/mybanner05.jpg>';
Layer1.Show();
Layer2 = new Layer();
Layer2.Style.left = '200px';
Layer2.SubjectStyle.color = 'red';
Layer2.Drag = false;
Layer2.Subject = '드래그 OFF 레이어';
Layer2.Content = '드래그 되지 않는 레이어<br>타이틀을 더블클릭하면 창이 축소됩니다.';
Layer2.Show();
Layer2.ContentStyle.backgroundColor = 'ivory';
Layer2.Refresh(); // Show() 호출 후 속성이 변경되면 Refresh() 호출
};
}
}
</script>
<!----><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
<script>
Layer = function() {
this.Elem = document.createElement('div');
this.Elem.id = 'Layer' + Layer.Count++;
this.Elem.appendChild(document.createElement('div'));
this.Elem.appendChild(document.createElement('div'));
// Properties
this.Id = this.Elem.id;
this.Drag = true;
this.Subject = 'Layer';
this.Content = 'Content';
this.Style = this.Elem.style;
this.SubjectStyle = this.Elem.children[0].style;
this.ContentStyle = this.Elem.children[1].style;
//
// Init
with(this.Style) {
position = 'absolute';
border = '1px solid slategray';
zIndex = Layer.ZIndex++;
}
with(this.SubjectStyle) {
font = 'bold 9pt tahoma';
backgroundColor = 'slategray';
color = 'lightgrey';
padding = '3px';
cursor = 'default';
}
with(this.ContentStyle) {
font = 'normal 9pt tahoma';
backgroundColor = 'whitesmoke';
color = 'slategray';
padding = '3px';
}
//
// Show Method
this.Show = function() {
document.body.appendChild(this.Elem);
this.Refresh();
}//
// Refresh Method
this.Refresh = function() {
this.Elem.children[1].innerHTML = this.Content;
with(this.Elem.children[0]) {
innerHTML = this.Subject;
onselectstart = function() { return false; }
style.width = Math.max(this.Elem.children[1].offsetWidth, offsetWidth);
ondblclick = function() {
with(this.parentElement.children[1].style) {
display = display ? '' : 'none';
}
}
// Drag Event
if(this.Drag) {
IsDrag = false;
var PadLeft = parseInt(style.paddingLeft);
var PadTop = parseInt(style.paddingTop);
onmousedown = function() {
IsDrag = true;
DragX = event.offsetX + PadLeft;
DragY = event.offsetY + PadTop;
}
onmouseup = function() { IsDrag = false; }
onmouseout = function() { IsDrag = false; }
onmousemove = function() {
if(IsDrag) {
with(this.parentElement.style) {
left = event.clientX - DragX;
top = event.clientY - DragY;
}
}
}
}
else {
IsDrag = DragX = DragY = null;
onmousedown = onmouseup = onmouseout = onmousemove = null;
}// End Drag Event
}
}// End Refresh()
// Event z-index
this.Elem.children[0].onclick = function() { this.parentElement.style.zIndex = Layer.ZIndex++; }
this.Elem.children[1].onclick = function() { this.parentElement.style.zIndex = Layer.ZIndex++; }
}
Layer.Count = 0;
Layer.ZIndex = 100;
</script>
<!---->
<!--사용-->
<script>
window.onload = function() {
with(document) {
with(body) {
Layer1 = new Layer();
Layer1.Subject = '드래그 ON 레이어';
Layer1.Content = '나 보기가 역겨워 가실때에는<br>' +
'말 없이 고이 보내 드리오리다.<br>' +
'<img src=http://mypds.mireene.com/g4/_v1/img/mybanner05.jpg>';
Layer1.Show();
Layer2 = new Layer();
Layer2.Style.left = '200px';
Layer2.SubjectStyle.color = 'red';
Layer2.Drag = false;
Layer2.Subject = '드래그 OFF 레이어';
Layer2.Content = '드래그 되지 않는 레이어<br>타이틀을 더블클릭하면 창이 축소됩니다.';
Layer2.Show();
Layer2.ContentStyle.backgroundColor = 'ivory';
Layer2.Refresh(); // Show() 호출 후 속성이 변경되면 Refresh() 호출
};
}
}
</script>
<!----><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
댓글 1개
pearly
19년 전
좋은팁 감사합니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 667 | ||
| 7629 |
|
10년 전 | 2410 | |
| 7628 | 10년 전 | 800 | ||
| 7627 |
|
10년 전 | 1043 | |
| 7626 |
|
10년 전 | 1799 | |
| 7625 | 10년 전 | 724 | ||
| 7624 | 10년 전 | 743 | ||
| 7623 |
|
10년 전 | 3116 | |
| 7622 | 10년 전 | 745 | ||
| 7621 |
leeleeleelee
|
10년 전 | 595 | |
| 7620 | 10년 전 | 548 | ||
| 7619 | 10년 전 | 501 | ||
| 7618 | 10년 전 | 1041 | ||
| 7617 | 10년 전 | 733 | ||
| 7616 | 10년 전 | 666 | ||
| 7615 | 10년 전 | 734 | ||
| 7614 | 10년 전 | 1277 | ||
| 7613 |
|
10년 전 | 2090 | |
| 7612 | 10년 전 | 1169 | ||
| 7611 | 10년 전 | 1431 | ||
| 7610 |
|
10년 전 | 1909 | |
| 7609 |
|
10년 전 | 1363 | |
| 7608 |
mwdkim
|
10년 전 | 1143 | |
| 7607 |
|
10년 전 | 1072 | |
| 7606 |
mwdkim
|
10년 전 | 3948 | |
| 7605 | 10년 전 | 698 | ||
| 7604 | 10년 전 | 1037 | ||
| 7603 | 10년 전 | 1658 | ||
| 7602 |
|
10년 전 | 1088 | |
| 7601 |
AniNest
|
10년 전 | 2804 | |
| 7600 |
port443
|
10년 전 | 1046 | |
| 7599 | 10년 전 | 954 | ||
| 7598 | 10년 전 | 1035 | ||
| 7597 | 10년 전 | 4583 | ||
| 7596 |
SeungYeon
|
10년 전 | 905 | |
| 7595 |
untitled
|
10년 전 | 2445 | |
| 7594 |
프로그래머7
|
10년 전 | 1745 | |
| 7593 |
untitled
|
10년 전 | 2387 | |
| 7592 |
untitled
|
10년 전 | 1955 | |
| 7591 |
untitled
|
10년 전 | 2689 | |
| 7590 |
아리마2001
|
10년 전 | 863 | |
| 7589 | 10년 전 | 1118 | ||
| 7588 |
|
10년 전 | 2932 | |
| 7587 | 10년 전 | 1317 | ||
| 7586 | 10년 전 | 679 | ||
| 7585 | 10년 전 | 1712 | ||
| 7584 | 10년 전 | 1419 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1181 | |
| 7582 |
|
10년 전 | 1140 | |
| 7581 | 10년 전 | 1367 | ||
| 7580 | 10년 전 | 1018 | ||
| 7579 |
|
10년 전 | 614 | |
| 7578 | 10년 전 | 1439 | ||
| 7577 |
|
10년 전 | 1883 | |
| 7576 | 10년 전 | 1396 | ||
| 7575 |
멋진남자임
|
10년 전 | 1478 | |
| 7574 | 10년 전 | 2131 | ||
| 7573 | 10년 전 | 3267 | ||
| 7572 | 10년 전 | 770 | ||
| 7571 |
|
10년 전 | 791 | |
| 7570 |
|
10년 전 | 1331 | |
| 7569 | 10년 전 | 1561 | ||
| 7568 |
this1mg
|
10년 전 | 1059 | |
| 7567 |
|
10년 전 | 775 | |
| 7566 | 10년 전 | 926 | ||
| 7565 |
Angel하늘
|
10년 전 | 1025 | |
| 7564 |
seoldi
|
10년 전 | 1269 | |
| 7563 |
|
10년 전 | 1406 | |
| 7562 |
멋진남자임
|
10년 전 | 2103 | |
| 7561 | 10년 전 | 722 | ||
| 7560 |
leeleeleelee
|
10년 전 | 922 | |
| 7559 | 10년 전 | 5064 | ||
| 7558 |
RinaP
|
10년 전 | 799 | |
| 7557 |
|
10년 전 | 1265 | |
| 7556 | 10년 전 | 1205 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1676 | |
| 7554 | 10년 전 | 1104 | ||
| 7553 |
senseme
|
10년 전 | 1348 | |
| 7552 |
ehdltdoit
|
10년 전 | 1446 | |
| 7551 |
|
10년 전 | 1839 | |
| 7550 |
leeleeleelee
|
10년 전 | 1605 | |
| 7549 | 10년 전 | 2442 | ||
| 7548 | 10년 전 | 1854 | ||
| 7547 |
멋진남자임
|
10년 전 | 1973 | |
| 7546 | 10년 전 | 1017 | ||
| 7545 |
ILMare1003
|
10년 전 | 1303 | |
| 7544 |
|
10년 전 | 1262 | |
| 7543 | 10년 전 | 898 | ||
| 7542 | 10년 전 | 676 | ||
| 7541 |
울라라라우
|
10년 전 | 874 | |
| 7540 | 10년 전 | 1604 | ||
| 7539 | 10년 전 | 949 | ||
| 7538 |
|
10년 전 | 1839 | |
| 7537 | 10년 전 | 3623 | ||
| 7536 |
Gaumi
|
10년 전 | 1426 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1288 | |
| 7534 |
senseme
|
10년 전 | 1213 | |
| 7533 | 10년 전 | 1214 | ||
| 7532 | 10년 전 | 879 | ||
| 7531 | 10년 전 | 2068 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기