我在几张图片上面放了一个Adsense广告。这些图像具有链接,并且根据页面查询字符串,它将显示或不显示先前的图像。将此广告置于这些图片之上时,会删除这些图片上的链接。实际上,当您右键单击时,您甚至无法访问这些图像。它会说"查看帧源"这是指Adsense广告。删除此广告时,图片可以正常工作,链接也可以正常工作。如何制作图像,即使广告位于图像顶部,图像也可以点击?
HTML / PHP
echo "<div class='bodyAd'>
<script async src='//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js'></script>
<ins class='adsbygoogle'
style='display:block'
data-ad-client= $pub_id
data-ad-slot= $ad_slot2
data-ad-format='auto'></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>";
echo "<div class='btns'>";
if ($num == $maxNum)
{
echo "<div id='prevBtn'><img class='prevBtn' src='/media/assets/prevBtn.png' style='display: none'/></div>";
}
else
{
$prevNum = $num + 1;
echo "<div id='prevBtn'><a href='$prevNum'><img class='prevBtn' src='/media/assets/prevBtn.png'/></a></div>";
}
if ($num == $minNum)
{
echo "<div id='nextBtn'><a href='/stories/$nextArticle'><img class='nextBtn' src='/media/assets/nextBtn.png'></a></div>";
}
else
{
$nextNum = $num - 1;
echo "<div id='nextBtn'><a href='$nextNum'><img class='nextBtn' src='/media/assets/nextBtn.png'></a></div>";
}
echo "</div>";
CSS
.btns{
display: block;
overflow: hidden;
width: 100%;
margin-top: 50px;
}
.nextBtn{
width: 35%;
margin-top: 20px;
margin-bottom: 25px;
float: right;
}
.prevBtn{
width: 35%;
margin-top: 20px;
margin-bottom: 25px;
float: left;
}