채택완료

그누4에 있는 쪽지 알림 이용하려고 하는데요. 스크립트가 제대로 동작을 하지 않아서요.

2014-11-06 (목) 17:38:09 5,502

다른 부분들은 g4 -> G5 또는 G5_BBS_URL 등으로 변경을 하니 잘 됩니다. 그래서인지 쪽지가 보내지면 오른쪽 하단 메세지가 뜨는 것 까지는 되네요.

그런데, 링크를 누르면 동작을 하지 않아요. 아마도 스크립트 부분을 제대로 인식 못하는 것 같아서요.

스크립트 내용이 아래와 같습니다.

function win_memo_animate(url)
 $('.animate_layer').css('display', 'none');
    if (!url){
         url = <? echo G5_BBS_URL ?> + "/memo.php";
    }
    win_open(url, "winMemo", "left=50,top=50,width=620,height=460,scrollbars=1");
}

|

답변 2개 / 댓글 1개

채택된 답변
+20 포인트

win_open 함수가 ​정의되어 있지 않습니다.

답변에 대한 댓글 1개

감사합니다.
win_open대신에 기본적으로 있는 popup_window를 사용하니까 제대로 됩니다.

혹시 몰라 전체 소스 추가합니다.

Copy
<?     if ($member['mb_id']) {        $sql = " select count(*) as cnt from {$g5['memo_table']} where me_recv_mb_id = '{$member['mb_id']}' and me_read_datetime = '0000-00-00 00:00:00' ";        $row = sql_fetch($sql);        $memo_not_read = $row['cnt'];    }?><? if($memo_not_read > 0){ ?><div class="animate_layer">    <div style="height:15px; padding:7px 0 0 110px;"><img src=<? echo G5_BBS_URL ?>/img/animate_close.png id="animate_close" style="cursor:pointer;"></div>  <div style="padding:10px;"><a href="javascript:win_memo_animate();">확인하지 않은 쪽지가 (<?=$memo_not_read?>)건 있습니다.</a></div></div><style>.animate_layer a:link, .animate_layer a:visited, .animate_layer a:active { text-decoration:none; color:#ffffff; }.animate_layer a:hover { text-decoration:underline; }.animate_layer {  top: 0px; left: 0px; width: 130px; height: 70px; position: absolute; display:none; color:#ffffff; background-color:#666666; background: url(<? echo G5_BBS_URL ?>/img/animate_bg.gif) no-repeat;}</style><script>function win_memo_animate(url){ $('.animate_layer').css('display', 'none');      if (!url){         url = <? echo G5_BBS_URL ?> + "/memo.php";    }    win_open(url, "winMemo", "left=50,top=50,width=620,height=460,scrollbars=1");}$('#animate_close').click(function(){ $('.animate_layer').css('display', 'none');});  function animate_layer_open(){     if(window.innerWidth){  windowWidth = window.innerWidth; }else{  if(document.documentElement && document.documentElement.clientWidth){    windowWidth = document.documentElement.clientWidth;  }else{    if(document.body){     windowWidth = document.body.offsetWidth;    }  } }     if(window.innerHeight){  windowHeight = window.innerHeight; }else{  if(document.documentElement && document.documentElement.clientHeight){   windowHeight=document.documentElement.clientHeight;  }else{   if(document.body){   windowHeight = document.body.clientHeight;   }  } }     var height_tmp = jQuery("div.animate_layer").height()+30; var windowHeight_tmp = windowHeight; var windowWidth_tmp = windowWidth - $("div.animate_layer").width()-40;  $("div.animate_layer").css({ top:windowHeight_tmp + "px", left:windowWidth_tmp + "px"}); $("div.animate_layer").show().animate({top:"-=" + height_tmp + "px"}, 1000)}  jQuery(document).ready(function(){ jQuery("body").animate({scrollTop:0},"slow",function(){ setTimeout(animate_layer_open,200) } )});</script><? } ?>​
 

답변을 작성하려면 로그인이 필요합니다.