我想知道我该怎么做这个 每个用户每天只能点击 2 次,当用户点击此广告时,如何使该广告在新窗口中打开
<div class="thumbnail">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-" data-ad-slot="" data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
最佳答案
var clickedAd = [null, null];
document.getElementById("myCheck").onclick = function(){
clickedAd.forEach(function(idx, ele){
if(ele == null){
ele[idx] = "something";
}
}
if(clickedAd[1] !== null){
document.getElementById("id-to-hide").style.display = "none";
setTimeout(function(){
clickedAd = [null, null];
}, 86400000);
} else {
document.getElementById("id-to-hide").style.display = "block";
}
};
像这样的事情应该做的事情
关于javascript - 如何在每个用户每天点击 2 次后禁用 <div>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45129329/