명예의 전당
블로그 포럼
꿀팁 분류

애드핏 PC와 모바일에서 다른광고 나오게 하는 코드입니다

컨텐츠 정보

  • 533 조회

본문



1024px 이상에서는 728x90, 768px 이하에서는 300x250 광고가 나오게 하려면 다음과 같이 합니다.




<script>

if ( window.matchMedia( '( min-width: 1024px )' ).matches == true ) {

document.write( '<ins class="kakao_ad_area" style="display:none;" data-ad-unit = "xxx" data-ad-width = "728" data-ad-height = "90"></ins><script type="text/javascript" src="//t1.daumcdn.net/adfit/static/ad.min.js" async><\/script>' );

}

if ( window.matchMedia( '( max-width: 768px )' ).matches == true ) {

document.write( '<ins class="kakao_ad_area" style="display:none;" data-ad-unit = "xxx" data-ad-width = "300" data-ad-height = "250"></ins><script type="text/javascript" src="//t1.daumcdn.net/adfit/static/ad.min.js" async><\/script>' );

}

</script>



위의 코드를 맞게 변형해서 사용하면 됩니다.

 

관련자료

댓글 0
등록된 댓글이 없습니다.

Total 36 / 1 Page
번호
제목
이름
최근 달린 댓글
회원 설문조사

나는 애드센스가..

사이트 통계
  • 현재 접속자 93 명
  • 오늘 방문자 2,322 명
  • 어제 방문자 1,642 명
  • 최대 방문자 7,797 명
  • 전체 방문자 1,039,320 명
  • 전체 회원수 3,731 명
  • 전체 게시물 5,641 개
  • 전체 댓글수 21,298 개