文章目录[隐藏]
手机端网站头部底部悬浮代码,含JS和HTML版本适用于手机端,PC端也是显示,如单独使用可自行添加判断!
广告代码
HTML版:
<style>
#topNavad{background-color:#fff0; z-index:999; position:fixed; top:0; left:0; width:100%; _position:absolute;
_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); overflow:visible; }
#bottomNavad{background-color:#fff0; z-index:999; position:fixed; bottom:0; left:0; width:100%; _position:absolute;
_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); overflow:visible; }
</style>
<!--头部-->
<div id="topNavad">
<div id="MyDiv2">
<div id="newsImg">
<center>
<a href="https://www.baidu.com" rel="nofollow" target="_blank">
<img src="shunwang.jpg" title="AD" / style="width:100%">
</a>
</center>
</div>
<span onclick='CloseDiv("MyDiv2")' style="text-align:right; display:block;">关闭</span>
</div>
</div>
<!--头部end-->
<!--底部-->
<div id="bottomNavad">
<div id="MyDiv1">
<span onclick='CloseDiv("MyDiv1")' style="text-align:right; display:block;">关闭</span>
<center>
<a href="https://www.baidu.com" rel="nofollow" target="_blank">
<img src="shunwang.jpg" title="AD" / style="width:100%">
</a>
</center>
</div>
</div>
<!--底部end-->
<script>
function CloseDiv(div) {
document.getElementById(div).style.display = 'none';
};
</script>
JS版:
<script>
document.write("<style>");
document.write("#topNavad{background-color:#fff0; z-index:999; position:fixed; top:0; left:0; width:100%; _position:absolute;");
document.write("_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); overflow:visible; }");
document.write("#bottomNavad{background-color:#fff0; z-index:999; position:fixed; bottom:0; left:0; width:100%; _position:absolute;");
document.write("_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); overflow:visible; }");
document.write("<\/style>");
document.write("");
document.write(" ");
document.write("<!--头部-->");
document.write("<div id=\"topNavad\">");
document.write("<div id=\"MyDiv2\">");
document.write("<div id=\"newsImg\">");
document.write("<center>");
document.write("<a href=\"https:\/\/www.baidu.com\" rel=\"nofollow\" target=\"_blank\">");
document.write("<img src=\"shunwang.jpg\" title=\"AD\" \/ style=\"width:100%\">");
document.write("<\/a>");
document.write("<\/center>");
document.write("<\/div>");
document.write("<span onclick='CloseDiv(\"MyDiv2\")' style=\"text-align:right; display:block;\">关闭<\/span>");
document.write("");
document.write("<\/div>");
document.write("<\/div>");
document.write("<!--头部end-->");
document.write("");
document.write("<!--底部-->");
document.write("<div id=\"bottomNavad\">");
document.write("<div id=\"MyDiv1\">");
document.write("<span onclick='CloseDiv(\"MyDiv1\")' style=\"text-align:right; display:block;\">关闭<\/span>");
document.write("<center>");
document.write("<a href=\"https:\/\/www.baidu.com\" rel=\"nofollow\" target=\"_blank\">");
document.write("<img src=\"shunwang.jpg\" title=\"AD\" \/ style=\"width:100%\">");
document.write("<\/a>");
document.write("<\/center>");
document.write("<\/div>");
document.write("<\/div>");
document.write("<!--底部end-->");
document.write("");
function CloseDiv(div) {
document.getElementById(div).style.display = 'none';
};
</script>
公告: 本站提供的源码、模板、插件等等其他资源,除资源本身问题外,都不包含免费技术服务,如需技术支持需支付100+技术服务费,具体依客服说明为准,请大家谅解!
说明: 本站资源解压密码见“常见问题”,一般都为“www.360mb.net”!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
说明: 本站资源解压密码见“常见问题”,一般都为“www.360mb.net”!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。