| ¾È³»Ã¢ À§Ä¡½Ã۱â 2 | ¾È³»Ã¢ À§Ä¡½Ã۱â 1 |
±×¸®°í, nn4¿¡¼ ¾È³»Ã¢ÀÌ Ã³À½ Ãâ·Â½ÃÀÇ Àüü¹®¼ ¹ÛÀ¸·Î ·¹À̾ À§Ä¡½Ã۸é À̵¿ÇÑ ·¹À̾îÀÇ À§Ä¡¿¡ µû¸¥ À̵¿¸·´ë°¡ »ý±âÁö ¾Ê±â ¶§¹®¿¡ ¹Û¿¡ À§Ä¡ÇÑ ¾È³»Ã¢ÀÇ ÀϺδ ÆäÀÌÁö HTML ¼Ò½º¸¦ º¸Áö¾Ê´Â ÇÑ º¼ ¼ö°¡ ¾ø½À´Ï´Ù. À̵éÀÇ ¸ðµç ¹®Á¦¸¦ Áö±ÝºÎÅÍ ÇØ°áÇØ¾ß ÇÒ °ÍÀÔ´Ï´Ù.
¾È³»Ã¢ À§Ä¡½Ã۱â 1¿¡¼ »ç¿ëÇÑ ÄÚµå´Â ´Ü¼øÈ÷ ¸µÅ© ¾Æ·¡¿¡ ¾È³»Ã¢À» º¸¿©ÁÝ´Ï´Ù. ȸ麸´Ù Å« ¾È³»Ã¢À» º¸¸é ÇÑ ÆäÀÌÁö ¾Æ·¡¿¡ ¾È³»Ã¢ÀÇ ÀϺΰ¡ ³õÀÌ°Ô µÇ¾î À̵¿¸·´ë¸¦ ²ø¾î¿Å°Ü¾ß Àüü ¾È³»Ã¢À» º¼ ¼ö ÀÖ°í ¸¸¾à ÆäÀÌÁö °¡Àå ¾Æ·¡³ª À§¿¡ ÀÖ´Â ¸µÅ©ÀÇ °æ¿ì nn4¿¡¼ ¾È³»Ã¢ÀÇ ÀϺθ¦ º¼ ¼ö°¡ ¾ø´Â ¹®Á¦°¡ ÀÖ½À´Ï´Ù. ±×·¡¼ ÀÌµé ¹®Á¦¸¦ ÇØ°áÇÒ ¼ö ÀÖ´Â Äڵ带 À§ÀÇ Äڵ忡 ³Ö¾îÁÖ¾î¾ß ÇÕ´Ï´Ù.
°¡´ÉÇÑ ÇÑ ÆäÀÌÁö¿¡ ¾È³»Ã¢À» ´Ù º¸ÀÌ°Ô Çϱâ À§Çؼ À̰ÍÀú°Í ÇØº¸´Ù°¡ ¸µÅ©ÀÇ Áß¾Ó¿¡ ¾È³»Ã¢À» º¸ÀÌ°Ô Çß½À´Ï´Ù. ÇÑ ÆäÀÌÁö°¡ ³Ñ¾î°¡´Â ÆäÀÌÁö¿¡¼ ¾È³»Ã¢ÀÇ Å©±â¿¡ µû¶ó ÇÑ ÆäÀÌÁö¿¡ µÎ°í ÇÑ ÆäÀÌÁö°¡ ³ÑÀ¸¸é º¸ÀÌ´Â ÆäÀÌÁö °¡Àå À§¿¡ ¾È³»Ã¢À» À§Ä¡ ½ÃÄѼ À̵¿¸·´ëÀÇ »ç¿ëÀ» ÃÖ¼ÒÈÇÕ´Ï´Ù. À̰ÍÀ» Çϱâ À§Çؼ ¸µÅ©¿¡¼ÀÇ ¾È³»Ã¢°ú ÆäÀÌÁöÀÇ ³ÐÀÌ °ü°è¸¦ 5°¡Áö ±¸¿ªÀ¸·Î ³ª´³½À´Ï´Ù.
¸µÅ©¸¦ ´·¶À» ¶§ ¾È³»Ã¢ÀÌ ³ª¿Ã ¼ö ÀÖ´Â ¸ðµç °æ¿ì¸¦ ¿¹»óÇÏ¿© Àüü ÆäÀÌÁö¿¡¼ À§Ä¡¿Í °¡´ÉÇÑ ÇÑ È¸é¿¡ ³õ±â¸¦ ÆÇ´ÜÇÒ ¼ö ÀÖ½À´Ï´Ù. À§ÀÇ 5°¡Áö °æ¿ì¸¦ Á¿쵵 °°ÀÌ Àû¿ëÀ» ÇÕ´Ï´Ù.
5°¡Áö °æ¿ì¿¡¼ ´Ù·ç¾î¾ß ÇÒ ³»¿ëÀº..
<a href="#" onClick="showLayer('¾È³»Ã¢ ·¹À̾î', event); return false">¾È³»Ã¢ º¸±â</a>
·Î º¸¿©ÁÙ ¾È³»Ã¢°ú ¸µÅ©¸¦ ´·¶À» ¶§ÀÇ ÁÂÇ¥°ªÀ» ÂüÁ¶Çϱâ À§Çؼ event object¸¦ ó¸®ÇÔ¼ö showLayer()¿¡°Ô º¸³À´Ï´Ù.
·Î ÆäÀÌÁö¿¡¼ ³ôÀÌ¿Í ³ÐÀÌ¿¡ µû¶ó ¾È³»Ã¢À» À§Ä¡½Ã۱â À§ÇØ heightCenter()ÇÔ¼ö¿¡°Ô ¾È³»Ã¢ ·¹À̾î¿Í ¸µÅ©ÀÇ event¸¦ ó¸®ÇÔ¼ö¿¡°Ô º¸³À´Ï´Ù.
·Î ¾È³»Ã¢À» ¸µÅ©¸¦ ±âÁØÀ¸·Î ÆäÀÌÁö¿¡¼ ³ôÀÌ À§Ä¡¸¦ ÁöÁ¤ÇÕ´Ï´Ù.
ÆäÀÌÁö ³ÐÀÌ¿¡ µû¸¥ widthCenter()ÀÇ °æ¿ìµµ °°Àº ¹æ½ÄÀ¸·Î Á¦¾îÇÕ´Ï´Ù. ±×¸®°í, °¢ ¾È³»Ã¢¿¡´Â ´ÝÀ» ¼ö ÀÖ´Â ¸µÅ©¸¦ ³Ö¾îÁà¾ßÁö ¾È³»Ã¢À» º¸°í ÆäÀÌÁöÀÇ ³»¿ëÀ» º¼ ¼ö ÀÖ½À´Ï´Ù.
<a href="#" onClick="hideLayer('S1'); return false">close</a>
ÀÇ ¸µÅ©¸¦ ¾È³»Ã¢ ·¹À̾ ³Ö¾îÁÖ°í close ¸¦ ´©¸£¸é âÀ» ´Ý½À´Ï´Ù. hideLayer()´Â ¾È³»Ã¢ ·¹À̾îÀÇ visibility¸¦
hiddenÀ¸·Î ÁöÁ¤ÇÏ¿© âÀ» ´Ý½À´Ï´Ù.
function hideLayer(X) {
if(n4) {
document.layers[X].visibility = "hidden"
}
else if(e4) {
document.all[X].style.visibility = "hidden"
}
}
À§ÀÇ ½ÇÇàÇϱ⸦ ´©¸£¸é ¿©·¯°³ÀÇ À̹ÌÁö ¸µÅ©°¡ ³ª¿É´Ï´Ù. ÀÌ ¸µÅ© ¾Æ·¡¿¡ ºó °ø°£ÀÌ ³²¾ÆÀÖ´Â °ÍÀº ¼ûÀº ·¹À̾î Áß¿¡¼ Àüü ÆäÀÌÁöÀÇ ³ôÀ̺¸´Ù Å« ·¹À̾ Àֱ⠶§¹®ÀÔ´Ï´Ù. ¼ûÀº ·¹À̾ ÆäÀÌÁö Ãâ·Â½Ã °ø°£À» Â÷ÁöÇÕ´Ï´Ù.
³Ê¹« Å« ·¹À̾ ¾È³»Ã¢À¸·Î »ç¿ëÇÏ¸é ÆäÀÌÁöÀÇ ¾ç¿¡ µû¶ó¼ ÀÌ·± ºó°ø°£ÀÌ ³ª¿Ã ¼ö ÀÖ°í À̵¿¸·´ë¸¦ »ç¿ëÇÏ¿© ¾È³»Ã¢À» ºÁ¾ßÇϹǷΠ¾È³»Ã¢À¸·Î »ç¿ëÇÒ ·¹À̾îÀÇ Å©±â´Â °¡±ÞÀû ÇÑ ÆäÀÌÁö¸¦ ³ÑÁö ¾Ê´Â Å©±â·Î Çϸé ÀÌ·± ¹®Á¦µéÀ» ¿¹¹æÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ ÆäÀÌÁöÀÇ ¸ñÀûÀº ¾È³»Ã¢À¸·Î »ç¿ëÇÒ ·¹À̾îÀÇ Å©±â¿¡ »ó°ü¾øÀÌ ¸µÅ©¿Í °¡Àå °¡±õ°Ô âÀ» º¸¿©ÁÝ´Ï´Ù.
ÇѰ¡Áö ÁÖÀÇÁ¡À̶ó¸é ³Ê¹« Å« ·¹À̾ ¾È³»Ã¢À¸·Î »ç¿ë½Ã Á» È¥¶õ½º·¯¿ï ¼ö ÀÖ°í ¾È³»Ã¢ ·¹À̾îÀÇ ÁÂÇ¥´Â left:0 top:0À¸·Î óÀ½¿¡ ÁöÁ¤ÇؾßÁö ºó°ø°£ÀÌ ³ª¿ÀÁö ¾Ê½À´Ï´Ù.
.td { font-size:10pt; line-height:12pt; width:100 }
·Î class·Î Å©±â¸¦ ÁöÁ¤ÇÏ´ø°¡ °¢ tdÀ̳ª tableÅà ¾È¿¡ widthÀÇ °ªÀ» ÁöÁ¤ÇØ ÁÖ¸é ±× Å©±âÀÇ ±ÛÀÚµéÀº
ÁٳѱèÀ» ÇÕ´Ï´Ù.
function showLayer(X, e) {
var OBJ
if(n4) {
OBJ = document.layers[X]
OBJ.left = e.pageX - parseInt(OBJ.document.width/2)
OBJ.top = e.pageY
OBJ.visibility = "visible"
}
else if(e4) {
OBJ = document.all[X]
OBJ.style.pixelTop = event.clientY + document.body.scrollTop
OBJ.style.pixelLeft = event.clientX + document.body.scrollLeft
- parseInt(OBJ.offsetWidth/2)
OBJ.style.visibility = "visible"
}
}
|
function showLayer(X, e) {
if(n4) {
var OBJ = document.layers[X]
OBJ.top = heightCenter(OBJ, e)
OBJ.left = widthCenter(OBJ, e)
OBJ.visibility = "visible"
}
else if(e4) {
var OBJ = document.all[X]
OBJ.style.pixelTop = heightCenter(OBJ, event)
OBJ.style.pixelLeft = widthCenter(OBJ, event)
OBJ.style.visibility = "visible"
}
}
|
function heightCenter(OBJ, E) {
if(n4) {
var ODH = OBJ.document.height
var posTop = E.pageY - ODH/2
var posElementUp = E.pageY - ODH/2
var posElementDown = E.pageY + ODH/2
var screenUp = window.pageYOffset +2
// 2¸¦ ´õÇØÁÖ°í 2À» »©ÁذÍÀº nn4¿¡¼ ·¹À̾ border°¡ ÀÖÀ» °æ¿ì
// ´Ù¿îµÇ´Â °æ¿ì°¡ ÀÖ¾ú´Ù. ±×·¡¼ border¸¦ »©ÁÖ´Ï ÆäÀÌÁö¿Í ¾È³»Ã¢ °£ÀÇ
// ½Ã°¢ÀûÀÎ ±¸ºÐÀÌ Àß µÇÁö¾Ê¾Æ 2px, 2pxÀÇ °£°ÝÀ» µÎ¾ú´Ù.
var screenDown = window.pageYOffset + window.innerHeight -2
var posY = 0;
if(self != top) {
posY += 4
if( document.width > window.innerWidth+4 ) posY += -16 ;
screenDown += posY
}
else if(document.width > window.innerWidth) {
posY += -16
screenDown += posY
}
if(posElementUp > screenUp && posElementDown < screenDown) {
posTop = posElementUp;
}
else if( posElementDown > document.height ) {
while( (posElementDown > screenDown) && (posElementUp > screenUp) ) {
posElementDown--
posElementUp--
}
if(posElementDown > document.height && document.height > screenDown)
posElementUp = document.height - ODH;
}
else if(posElementUp < screenUp && posElementDown < screenDown) {
while( posElementDown < document.height && posElementUp < screenUp) {
posElementDown++;
posElementUp++
}
}
else if(posElementUp > screenUp && posElementDown > screenDown
&& posElementDown < document.height ) {
while( posElementDown > screenDown && posElementUp > screenUp) {
posElementDown--;
posElementUp--
}
}
else if(posElementUp < screenUp && posElementDown > screenDown ) {
while( posElementDown < document.height && posElementUp < screenUp) {
posElementDown++;
posElementUp++
}
}
posTop = posElementUp
if(posTop < 0) posTop=0;
if( posTop+ODH > document.height && document.height > screenDown)
posTop = document.height - ODH
}
else if(e4) {
var ODH = OBJ.offsetHeight
var posTop = E.clientY + document.body.scrollTop - ODH/2
var posElementUp = E.clientY + document.body.scrollTop - ODH/2
var posElementDown = E.clientY + document.body.scrollTop + ODH/2
var screenUp = document.body.scrollTop + 2
var screenDown = document.body.scrollTop + document.body.clientHeight - 2
if(posElementUp > screenUp && posElementDown < screenDown) {
posTop = posElementUp;
}
else if(posElementUp < screenUp && posElementDown < screenDown) {
while(posElementUp < screenUp) {
posTop++
posElementDown++;
posElementUp++
}
}
else if(posElementUp > screenUp && posElementDown > screenDown) {
while( posElementDown > screenDown && posElementUp > screenUp) {
posTop--
posElementDown--;
posElementUp--
}
}
else if(posElementUp < screenUp && posElementDown > screenDown ) {
while( posElementUp < screenUp) {
posTop++
posElementDown++;
posElementUp++
}
}
if( posTop < 0 ) posTop = 0;
}
return posTop
}
|