相信大家都有这样的经历,当我们在打开某一个网站的时候,在电脑屏幕的右下角会弹出来一个小广告窗口。如下图:

这个是如何制作出来的呢?在我们学做网站过程中,也可能在我们自己的网站中做出这样的效果。
在网页的底部标签上方粘贴以下的HTML代码:(相关教程:什么是HTML?)
<div id="rbbox"><a class="button" onclick="closeBox()">关闭</a><iframe src="https://www.xuewangzhan.net/" frameborder="0" height="200" width="300" scrolling="no"></iframe></div>
在标签下方,粘贴以下的JS代码:
<script language="javascript" type="text/javascript">
window.onload=function(){showBox();setTimeout("closeBox()",5000)}
function showBox(o){
if (o==undefined) o=document.getElementById("rbbox");
o.style.height=o.clientHeight+2+"px";
if (o.clientHeight<200) setTimeout(function(){showBox(o)},5);
}
function closeBox(){document.getElementById("rbbox").style.display="none";}
</script>
在网页头部标签上面粘贴以下的CSS样式代码:
<style type="text/css">
#rbbox{position:absolute;right:0;bottom:0;width:300px;height:0px;overflow:hidden}
.button{display:inline;float:right;font-size:12px;cursor:pointer}
</style>
这样,网站右下角弹出广告效果就制作好了。
,网站源码,免费源码,小程序源码,系统源码,Ai源码,DeepSeek,PHP源码,php,网站模板,商城源码,源码分享,源码下载,破解源码,资源分享,小程序源码,商业源码,牛角源码,牛角源码网, 源码分享平台, 开源项目