<!--클래스-->
<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년 전
좋은팁 감사합니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1230 |
|
18년 전 | 2018 | |
| 1229 |
|
18년 전 | 2955 | |
| 1228 |
|
18년 전 | 2642 | |
| 1227 | 18년 전 | 2939 | ||
| 1226 | 18년 전 | 2369 | ||
| 1225 |
|
18년 전 | 2442 | |
| 1224 | 18년 전 | 2753 | ||
| 1223 |
|
18년 전 | 4000 | |
| 1222 |
mixdesign
|
18년 전 | 2638 | |
| 1221 |
|
18년 전 | 2760 | |
| 1220 | 18년 전 | 3217 | ||
| 1219 | 18년 전 | 2926 | ||
| 1218 | 18년 전 | 2121 | ||
| 1217 |
|
18년 전 | 2563 | |
| 1216 | 18년 전 | 2583 | ||
| 1215 |
mixdesign
|
18년 전 | 4070 | |
| 1214 |
|
18년 전 | 4795 | |
| 1213 | 18년 전 | 2329 | ||
| 1212 |
mixdesign
|
18년 전 | 2510 | |
| 1211 |
|
18년 전 | 2435 | |
| 1210 | 18년 전 | 3763 | ||
| 1209 |
mixdesign
|
18년 전 | 2381 | |
| 1208 |
mixdesign
|
18년 전 | 2382 | |
| 1207 |
mixdesign
|
18년 전 | 1734 | |
| 1206 |
mixdesign
|
18년 전 | 2013 | |
| 1205 |
mixdesign
|
18년 전 | 2710 | |
| 1204 |
mixdesign
|
18년 전 | 3583 | |
| 1203 | 18년 전 | 3105 | ||
| 1202 | 18년 전 | 2987 | ||
| 1201 | 18년 전 | 2038 | ||
| 1200 | 18년 전 | 4135 | ||
| 1199 | 18년 전 | 2177 | ||
| 1198 | 18년 전 | 4201 | ||
| 1197 | 18년 전 | 2513 | ||
| 1196 | 18년 전 | 2373 | ||
| 1195 |
|
18년 전 | 3477 | |
| 1194 | 18년 전 | 2250 | ||
| 1193 | 18년 전 | 2157 | ||
| 1192 | 18년 전 | 3277 | ||
| 1191 | 18년 전 | 3967 | ||
| 1190 | 18년 전 | 2232 | ||
| 1189 |
|
18년 전 | 2375 | |
| 1188 |
|
18년 전 | 3841 | |
| 1187 | 18년 전 | 2724 | ||
| 1186 | 18년 전 | 3388 | ||
| 1185 | 18년 전 | 2795 | ||
| 1184 | 18년 전 | 1675 | ||
| 1183 | 18년 전 | 2148 | ||
| 1182 | 18년 전 | 3714 | ||
| 1181 |
mermaid
|
18년 전 | 2930 | |
| 1180 | 18년 전 | 2987 | ||
| 1179 | 18년 전 | 3616 | ||
| 1178 | 18년 전 | 2181 | ||
| 1177 |
|
18년 전 | 2295 | |
| 1176 | 18년 전 | 3184 | ||
| 1175 | 18년 전 | 1887 | ||
| 1174 |
|
18년 전 | 2242 | |
| 1173 |
|
18년 전 | 2531 | |
| 1172 | 18년 전 | 1780 | ||
| 1171 | 18년 전 | 2114 | ||
| 1170 | 18년 전 | 1998 | ||
| 1169 | 18년 전 | 2514 | ||
| 1168 | 18년 전 | 1939 | ||
| 1167 | 18년 전 | 1732 | ||
| 1166 | 18년 전 | 1756 | ||
| 1165 | 18년 전 | 1736 | ||
| 1164 | 18년 전 | 2804 | ||
| 1163 | 18년 전 | 1564 | ||
| 1162 |
|
18년 전 | 5685 | |
| 1161 |
이걸~어쩌나~
|
18년 전 | 2416 | |
| 1160 | 18년 전 | 1675 | ||
| 1159 | 18년 전 | 4708 | ||
| 1158 | 18년 전 | 2059 | ||
| 1157 | 18년 전 | 4847 | ||
| 1156 | 18년 전 | 3195 | ||
| 1155 | 18년 전 | 2138 | ||
| 1154 | 18년 전 | 1835 | ||
| 1153 |
BEST79
|
18년 전 | 2117 | |
| 1152 | 18년 전 | 1740 | ||
| 1151 | 18년 전 | 1850 | ||
| 1150 | 18년 전 | 1853 | ||
| 1149 |
inniskun
|
18년 전 | 2487 | |
| 1148 |
|
18년 전 | 3509 | |
| 1147 |
|
18년 전 | 5982 | |
| 1146 |
|
18년 전 | 3872 | |
| 1145 | 18년 전 | 3065 | ||
| 1144 | 18년 전 | 2150 | ||
| 1143 | 18년 전 | 2426 | ||
| 1142 | 18년 전 | 2212 | ||
| 1141 |
|
18년 전 | 2313 | |
| 1140 | 18년 전 | 2422 | ||
| 1139 | 18년 전 | 2851 | ||
| 1138 | 18년 전 | 2544 | ||
| 1137 | 18년 전 | 2004 | ||
| 1136 | 18년 전 | 3134 | ||
| 1135 | 18년 전 | 3599 | ||
| 1134 | 18년 전 | 3843 | ||
| 1133 |
자반고등어
|
18년 전 | 3351 | |
| 1132 | 18년 전 | 3401 | ||
| 1131 | 18년 전 | 2581 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기