모바일에서는 팝업이 안뜨게 하기

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
모바일에서는 팝업이 안뜨게 하기

QA

모바일에서는 팝업이 안뜨게 하기

본문

컴퓨터에서는 뜨고 모바일에서는 팝업이 안뜨게 하는 방법이 있나요?

고수님들 부탁드립니다.

http://wappleedu.com

이 질문에 댓글 쓰기 :

답변 5

스크립트에  

 if ( getCookie( "Notice[1]" ) != "done[1]" ){
window.open ('pop1.html','english1','left=500,top=112,width=800, height=848,scrollbars=no,toolbars=no,resizable=0');   
} 가 위에 한번 아래에 한번 이렇게 2개가 있어서 그럽니다.

 

head 안에 있는 script 부분 삭제하시고

아래의 스크립트만 넣어세요...


<SCRIPT language=javascript>
<!--
function getCookie( name ){
   var nameOfCookie = name + "=";
   var x = 0;
   while ( x <= document.cookie.length ){
        var y = (x+nameOfCookie.length);
        if ( document.cookie.substring( x, y ) == nameOfCookie ) {
             if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                  endOfCookie = document.cookie.length;
             return unescape( document.cookie.substring( y, endOfCookie ) );
        }
        x = document.cookie.indexOf( " ", x ) + 1;
        if ( x == 0 )
            break;
    }
return "";
}
var filter = "win16|win32|win64|mac";
if(navigator.platform){
    if(0 > filter.indexOf(navigator.platform.toLowerCase())){
        // mobile
    }else{
        // pc
        if ( getCookie( "Notice[1]" ) != "done[1]" ){
          window.open ('pop1.html','english1','left=500,top=112,width=800, height=848,scrollbars=no,toolbars=no,resizable=0');   
            }
    }
}
//-->
</SCRIPT>

 

 

 

head.php 파일  상단에 아래와 같이 해보세요

    <?php
    if(defined('_INDEX_') && G5_IS_MOBILE == false) { // index에서만 실행
        include G5_BBS_PATH.'/newwin.inc.php'; // 팝업레이어
    }
    ?>

 

 

 

PHP가 아닌데요 고수님

index 페이지를 열어보시면 팝업을 띄우는 스크립트 구문이 있습니다.

 

if ( getCookie( "Notice[1]" ) != "done[1]" ){
    window.open ('pop1.html','english1','left=500,top=112,width=800, height=848,scrollbars=no,toolbars=no,resizable=0');   
}

 

여기를 DEVICE 가 모바일인지 피씨인지 구분해서 실행하도록 하게 하면 됩니다.

 

EX)


<script type="text/javascript">
var filter = "win16|win32|win64|mac";
if(navigator.platform){
    if(0 > filter.indexOf(navigator.platform.toLowerCase())){
        // mobile
    }else{
        // pc
        if ( getCookie( "Notice[1]" ) != "done[1]" ){
          window.open ('pop1.html','english1','left=500,top=112,width=800, height=848,scrollbars=no,toolbars=no,resizable=0');   
            }
    }
}
</script>
답변을 작성하시기 전에 로그인 해주세요.
전체 3
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT