简体   繁体   English

Google广告视差背景

[英]Google ad parallax on background

I'm trying to put a google ad (iframe) on the background of a website and then let content scroll over it (parallax). 我正在尝试将google广告(iframe)放在网站的背景上,然后让内容在其上滚动(视差)。

I tried it in different ways, but nothing seems ideal. 我以不同的方式尝试了它,但是似乎没有一个理想的选择。 I tried it by putting the iframe fixed behind the content, but while scrolling, it's sometimes above the content. 我通过将固定的iframe放在内容后面来进行尝试,但是在滚动时,它有时位于内容之上。

I also tried making the ad and content absolute. 我还尝试将广告和内容设为绝对。 In this case I gave the content the height of the screen, and overflow-y: auto. 在这种情况下,我给内容提供了屏幕的高度,然后将其溢出-y:自动。 In this case the scrolling of the website seemed unnatural and it gave some conflicts with other elements on the page. 在这种情况下,网站的滚动看起来是不自然的,并且与页面上的其他元素产生了一些冲突。

I also tried putting the iframe within the content and then clipped it based on the scroll event of the page. 我还尝试将iframe放入内容中,然后根据页面的滚动事件对其进行裁剪。 In this case, the add 'buzzed' on the background. 在这种情况下,背景会“嗡嗡作响”。

Any other ideas what I could try? 还有其他想法我可以尝试吗? Kind regards 亲切的问候

As per google adsense policy - 根据Google Adsense政策-

Drawing unnatural attention to ads includes placing Google ads in a floating box script that causes the ad to appear in a “sticky" position on the page as the user scrolls down. This type of ad implementation is not permitted. 引起对广告不自然的关注包括将Google广告放置在浮动框脚本中,该脚本会使用户在用户向下滚动时显示在页面上的“粘滞”位置,这是不允许的。

Adsense Policy Adsense政策

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM