懸浮廣告代碼-js手機端網站底部和頭部懸浮html廣告代碼教程【附實例】


<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>

懸浮廣告代碼-js手機端網站底部和頭部懸浮html廣告代碼教程-移動端的懸浮廣告代碼

 

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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM