레이어 브라우저 호환 문제 정보
레이어 브라우저 호환 문제
본문
위와 같이 제목을 클릭하면 관련 정보가 뜨도록 레이어를 만들었는데
희안하게 익스9에서만 작동하고 크롬과 파이어폭스에서는 작동을 하지 않습니다
혹시 익스전용 명령을 쓴게 아닌가해서 분석해보았는데 별다른 특징을 찾지못했습니다
아래는 해당 php의 레이어 관련 소스이며 해당 URL은
http://www.gamereporters.com/bbs/board.php?bo_table=schedule 입니다
답변부탁드려요
<script language="JavaScript">
<!--
function namosw_goto_byselect(sel, targetstr)
{
var index = sel.selectedIndex;
if (sel.options[index].value != '') {
if (targetstr == 'blank') {
window.open(sel.options[index].value, 'win1');
} else {
var frameobj;
if (targetstr == '') targetstr = 'self';
if ((frameobj = eval(targetstr)) != null)
frameobj.location = sel.options[index].value;
}
}
}
// 레이어 뷰 스크립트
var iDelay = 80 // Delay to hide in milliseconds
var iNSWidth=250 // Default width for netscape
var sDisplayTimer = null, oLastItem
function getRealPosition(i,which) {
iPos = 0
while (i!=null) {
iPos += i["offset" + which]
i = i.offsetParent
}
return iPos
}
function showLayers(sDest,itop,ileft,iWidth) {
if (document.all!=null) {
var i = window.event.srcElement
stopTimer()
dest = document.all[sDest]
if ((oLastItem!=null) && (oLastItem!=dest))
hideItem()
if (dest) {
// Netscape Hack
if (i.offsetWidth==0)
if (iWidth)
i.offsetWidth=iWidth
else
i.offsetWidth=iNSWidth;
if (ileft)
dest.style.pixelLeft = ileft
else
dest.style.pixelLeft = getRealPosition(i,"Left") - 5 // 불러오는 메뉴 좌표
// dest.style.pixelLeft = getRealPosition(i,"Left") + i.offsetWidth *0.1 // 불러오는 메뉴 좌표
if (itop)
dest.style.pixelTop = itop
else
dest.style.pixelTop = getRealPosition(i,"Top") + 15 // 불러오는 메뉴 좌표
dest.style.visibility = "visible"
}
oLastItem = dest
}
}
function stopTimer() {
clearTimeout(sDisplayTimer)
}
function startTimer(el) {
if (!el.contains(event.toElement)) {
stopTimer()
sDisplayTimer = setTimeout("hideItem()",iDelay)
}
}
function hideItem() {
if (oLastItem)
oLastItem.style.visibility="hidden"
}
function checkOver() {
if ((oLastItem) && (oLastItem.contains(event.srcElement))) {
stopTimer()
}
}
function checkOut() {
if (oLastItem==event.srcElement)
startTimer(event.srcElement)
}
document.onclick = checkOver
document.onclick = checkOut
//-->
</SCRIPT>
---------------------------------------------------------------
<?
$j=0; // layer id
// 내용을 보여주는 부분
while ($row = mysql_fetch_array($result)) {
if( substr($row[wr_link1],0,6) < $year.$cel_mon ) {
$start_day =1;
$start_day= (int)$start_day;
} else {
$start_day = substr($row[wr_link1],6,2);
$start_day= (int)$start_day;
}
if( substr($row[wr_link2],0,6) > $year.$cel_mon ) {
$end_day = $lastday[$month];
$end_day= (int)$end_day;
} else {
$end_day = substr($row[wr_link2],6,2);
$end_day= (int)$end_day;
}
for ($i = $start_day ; $i <= $end_day; $i++) {
$j++; // layer ID
switch ($row[wr_3]) {
case 1 :
$html_day[$i].= "<br><img src='$board_skin_path/img/1.png' border=0 align=absmiddle>";
~~~생략
$html_day[$i].= "<a onclick=\"showLayers('popup_schd".$j."')\" onclick=\"startTimer(this)\"
style='font-family:NanumGothicBoldWeb; cursor:pointer;'>["
.$row[ca_name]."]".$row[wr_subject]."</a>"."<br>"."\n";
$list[$i][file]=get_file($bo_table, $row[wr_id]); ?>
---------------------------------------------------------------
<DIV ID="popup_schd<?=$j?>" onclick="startTimer(event.srcElement)" style="BORDER-RIGHT: #DFDFDF 1px solid; BORDER-TOP: #DFDFDF 1px solid; BORDER-LEFT: #DFDFDF 1px solid; BORDER-BOTTOM: #DFDFDF 1px solid; BACKGROUND-COLOR: #ffffff; padding: 5 5 5 5; POSITION: absolute; top:-200px; visibility: hidden; Z-INDEX: 1; font-family: NanumGothicBoldWeb;">
---------------------------------------------------------------
희안하게 익스9에서만 작동하고 크롬과 파이어폭스에서는 작동을 하지 않습니다
혹시 익스전용 명령을 쓴게 아닌가해서 분석해보았는데 별다른 특징을 찾지못했습니다
아래는 해당 php의 레이어 관련 소스이며 해당 URL은
http://www.gamereporters.com/bbs/board.php?bo_table=schedule 입니다
답변부탁드려요
<script language="JavaScript">
<!--
function namosw_goto_byselect(sel, targetstr)
{
var index = sel.selectedIndex;
if (sel.options[index].value != '') {
if (targetstr == 'blank') {
window.open(sel.options[index].value, 'win1');
} else {
var frameobj;
if (targetstr == '') targetstr = 'self';
if ((frameobj = eval(targetstr)) != null)
frameobj.location = sel.options[index].value;
}
}
}
// 레이어 뷰 스크립트
var iDelay = 80 // Delay to hide in milliseconds
var iNSWidth=250 // Default width for netscape
var sDisplayTimer = null, oLastItem
function getRealPosition(i,which) {
iPos = 0
while (i!=null) {
iPos += i["offset" + which]
i = i.offsetParent
}
return iPos
}
function showLayers(sDest,itop,ileft,iWidth) {
if (document.all!=null) {
var i = window.event.srcElement
stopTimer()
dest = document.all[sDest]
if ((oLastItem!=null) && (oLastItem!=dest))
hideItem()
if (dest) {
// Netscape Hack
if (i.offsetWidth==0)
if (iWidth)
i.offsetWidth=iWidth
else
i.offsetWidth=iNSWidth;
if (ileft)
dest.style.pixelLeft = ileft
else
dest.style.pixelLeft = getRealPosition(i,"Left") - 5 // 불러오는 메뉴 좌표
// dest.style.pixelLeft = getRealPosition(i,"Left") + i.offsetWidth *0.1 // 불러오는 메뉴 좌표
if (itop)
dest.style.pixelTop = itop
else
dest.style.pixelTop = getRealPosition(i,"Top") + 15 // 불러오는 메뉴 좌표
dest.style.visibility = "visible"
}
oLastItem = dest
}
}
function stopTimer() {
clearTimeout(sDisplayTimer)
}
function startTimer(el) {
if (!el.contains(event.toElement)) {
stopTimer()
sDisplayTimer = setTimeout("hideItem()",iDelay)
}
}
function hideItem() {
if (oLastItem)
oLastItem.style.visibility="hidden"
}
function checkOver() {
if ((oLastItem) && (oLastItem.contains(event.srcElement))) {
stopTimer()
}
}
function checkOut() {
if (oLastItem==event.srcElement)
startTimer(event.srcElement)
}
document.onclick = checkOver
document.onclick = checkOut
//-->
</SCRIPT>
---------------------------------------------------------------
<?
$j=0; // layer id
// 내용을 보여주는 부분
while ($row = mysql_fetch_array($result)) {
if( substr($row[wr_link1],0,6) < $year.$cel_mon ) {
$start_day =1;
$start_day= (int)$start_day;
} else {
$start_day = substr($row[wr_link1],6,2);
$start_day= (int)$start_day;
}
if( substr($row[wr_link2],0,6) > $year.$cel_mon ) {
$end_day = $lastday[$month];
$end_day= (int)$end_day;
} else {
$end_day = substr($row[wr_link2],6,2);
$end_day= (int)$end_day;
}
for ($i = $start_day ; $i <= $end_day; $i++) {
$j++; // layer ID
switch ($row[wr_3]) {
case 1 :
$html_day[$i].= "<br><img src='$board_skin_path/img/1.png' border=0 align=absmiddle>";
~~~생략
$html_day[$i].= "<a onclick=\"showLayers('popup_schd".$j."')\" onclick=\"startTimer(this)\"
style='font-family:NanumGothicBoldWeb; cursor:pointer;'>["
.$row[ca_name]."]".$row[wr_subject]."</a>"."<br>"."\n";
$list[$i][file]=get_file($bo_table, $row[wr_id]); ?>
---------------------------------------------------------------
<DIV ID="popup_schd<?=$j?>" onclick="startTimer(event.srcElement)" style="BORDER-RIGHT: #DFDFDF 1px solid; BORDER-TOP: #DFDFDF 1px solid; BORDER-LEFT: #DFDFDF 1px solid; BORDER-BOTTOM: #DFDFDF 1px solid; BACKGROUND-COLOR: #ffffff; padding: 5 5 5 5; POSITION: absolute; top:-200px; visibility: hidden; Z-INDEX: 1; font-family: NanumGothicBoldWeb;">
---------------------------------------------------------------
댓글 전체
스크립트를 바꾸셔야 할듯 하네요
http://www.jacklmoore.com/colorbox/
http://www.jacklmoore.com/colorbox/
불량학생님 답변감사합니다 잘 참고하겠습니다