当url中存在#时,GPT脚本强制滚动到ad
GPT script forces scroll down to ad when # exists in url
还有其他人有这个问题吗?
当URL中存在散列时,google publisher标签强制页面在加载时向下滚动到广告,如果页面刷新,它向下滚动到广告,然后在刷新之前跳回到原始位置。
我正在使用的脚本似乎没有什么不寻常的。
定义脚本:<script type="text/javascript">
googletag.cmd.push(function() {
googletag
.defineSlot('/site/test', [[300, 250]], 'gpt-ad-sto-300-250-0')
.addService(googletag.pubads())
.setTargeting('sec', 'Home')
.setTargeting('pos', 'sto');
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
广告位置:
<div id="gpt-ad-sto-300-250-0">
<script type="text/javascript">
googletag.cmd.push(function() { googletag.display('gpt-ad-sto-300-250-0'); });
</script>
</div>
我今天遇到了完全相同的问题,我发现解决这个问题的唯一解决方案是从url中删除哈希。
相关文章:
- JavaScript滚动脚本-在测试中激发,而不是在开发站点上
- 为什么'滚动到顶部'脚本导致类型错误?jQuery冲突
- 使用我的基于标签的平滑滚动脚本而不带“a”的解决方案
- 表单验证自动滚动修改脚本
- 在触发无限滚动时运行脚本
- jQuery脚本滚动在iDevices上不兼容
- Javascript一页滚动脚本滚动到每个点击的链接一个接一个
- 滚动邮件's的类似gmail的body,带有使用java脚本的固定页脚
- 使用java脚本将Android WebView滚动到下一页
- 滚动到不与溢出一起工作的顶部脚本:滚动
- 引导程序导航栏未使用平滑滚动脚本折叠
- 动画滚动脚本可防止从外部链接访问本地锚点位置
- 向下滚动并使用 Java 脚本修复标头
- 如何在Twitter对话中的每个无限滚动事件上执行Greasemonkey脚本
- 如何将我的脚本应用于通过无限滚动加载的图像
- 进入页面时未知的javascript脚本向下滚动
- 平滑滚动脚本问题
- 修改此滚动导航菜单脚本
- 单击停止脚本滚动回页面顶部
- 如何使用java脚本滚动到富文本框中的指定行