테스트 사이트 - 개발 중인 베타 버전입니다

$is_mobile이 먹히지않습니다 채택완료

서포터즈 4년 전 조회 4,188

http://goomgoom.edenstore.co.kr/

 

주소는 여기구요

 

 

 

이렇게 되어있는부분을 모바일로보면 유튜브 동영상이 아래로 가있습니다

 

이상하게 유튜브 영상만 이러더라고요 다른부분 괜찮아서

 

<?php if($is_mobile) { ?>
    <iframe style="position:absolute; left:50%; top:30%; z-index:99;" width="560" height="315" src="https://www.youtube.com/embed/X79qWJI2NHM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<? } ?>
<?php if(!$is_mobile) { ?>
    <iframe style="position:absolute; left:50%; top:30%; z-index:99;" width="560" height="315" src="https://www.youtube.com/embed/X79qWJI2NHM" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<? } ?>

 

이부분만 mobile일때 별개로처리하려고하는데

 

is_mobile이 먹히지않습니다

 

is_mobile일때 echo 찍어서 값나오나 확인해도 pc일때로만 넘어갑니다

 

혹시 왜이런지 알수있을까요 ?

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

답변 1개

채택된 답변
+20 포인트
진서기
4년 전

if(is_mobile()){

 

}

 

사용해보세요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

서포터즈
4년 전
변함이 없습니다.

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

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

로그인