애드핏 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>
위의 코드를 맞게 변형해서 사용하면 됩니다.
-
등록일 2024.02.28
-
등록일 2023.10.20
-
등록일 2023.09.02
-
등록일 2023.09.01
-
등록일 2023.08.28네이버 블로그 본문 광고 추가댓글 1
관련자료
- 1(current)