这段js代码为什么在chrome和Microsoft Edge中不能正确运行
<!--悬浮窗--><divstyle="z-index:10;font-size:12px;height:146px;width:170px;position:abso...
<!--悬浮窗-->
<div style="z-index:10;font-size:12px; height:146px; width:170px; position: absolute; left: 0;bottom:0px; line-height: 18px;" id="ad">
<a href="" target="_blank">
<img width="162" src="images/sd.png" alt="" />
</a>
<a style="cursor:hand; position:absolute; right:72px; color:#4F8B00; font-size:9px;" onClick="toueme()">关闭</a>
</div>
<script type="text/javascript">
function toueme() {
document.getElementById("ad").style.display = "none";
}
function rightBottomAd() {
var abc = document.getElementById("ad");
abc.style.top = document.documentElement.scrollTop + document.documentElement.clientHeight - 250 + "px";
setTimeout(function(){rightBottomAd();}, 50);
}
</script>
<script type="text/javascript">
rightBottomAd();
</script>
如何才能兼容这两个浏览器 展开
<div style="z-index:10;font-size:12px; height:146px; width:170px; position: absolute; left: 0;bottom:0px; line-height: 18px;" id="ad">
<a href="" target="_blank">
<img width="162" src="images/sd.png" alt="" />
</a>
<a style="cursor:hand; position:absolute; right:72px; color:#4F8B00; font-size:9px;" onClick="toueme()">关闭</a>
</div>
<script type="text/javascript">
function toueme() {
document.getElementById("ad").style.display = "none";
}
function rightBottomAd() {
var abc = document.getElementById("ad");
abc.style.top = document.documentElement.scrollTop + document.documentElement.clientHeight - 250 + "px";
setTimeout(function(){rightBottomAd();}, 50);
}
</script>
<script type="text/javascript">
rightBottomAd();
</script>
如何才能兼容这两个浏览器 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询