js 右下角 不移动 弹窗广告 带关闭按钮(不支持 谷歌)
来源:互联网 发布:nvidia游戏优化怎么样 编辑:程序博客网 时间:2024/05/16 10:49
<style type="text/css">
body { background:#333333;}
#winpop { width:200px; height:0px; position:absolute; right:0; bottom:0; border:1px solid #999999; margin:0; padding:1px; overflow:hidden;display:none; background:#FFFFFF}
#winpop .title { width:100%; height:20px; line-height:20px; background:#FFCC00; font-weight:bold; text-align:center; font-size:12px;}
#winpop .con { width:100%; height:80px; line-height:80px; font-weight:bold; font-size:12px; color:#FF0000; text-decoration:underline; text-align:center}
#silu { font-size:13px; color:#999999; position:absolute; right:0;bottom:0px; text-align:right; text-decoration:underline; line-height:22px;}
.close { position:absolute; right:4px; top:-1px; color:#FFFFFF; cursor:pointer}
</style>
<script type="text/javascript">
function show_pop(){//显示窗口
document.getElementById("winpop").style.display="block";
timer=setInterval("changeH(4)",2);//调用changeH(4),每0.002秒向上移动一次
}
function hid_pop(){//隐藏窗口
timer=setInterval("changeH(-4)",2);//调用changeH(-4),每0.002秒向下移动一次
}
function changeH(addH) {
var MsgPop=document.getElementById("winpop");
var popH=parseInt(MsgPop.style.height||MsgPop.currentStyle.height);//用parseInt将对象的高度转化为数字,以方便下面比较(JS读<style>中的height要用"currentStyle.height")
if (popH<=100&&addH>0||popH>=4&&addH<0){//如果高度小于等于100(str>0)或高度大于等于4(str<0)
MsgPop.style.height=(popH+addH).toString()+"px";//高度增加或减少4个象素
}
else{//否则
clearInterval(timer);//取消调用,意思就是如果高度超过100象素了,就不再增长了,或高度等于0象素了,就不再减少了
MsgPop.style.display=addH>0?"block":"none"//向上移动时窗口显示,向下移动时窗口隐藏(因为窗口有边框,所以还是可以看见1~2象素没缩进去,这时候就把DIV隐藏掉)
}
}
window.onload=function(){//加载
setTimeout("show_pop()",800);//0.8秒后调用show_pop()
}
</script>
<body>
<div id="silu">
<button onclick="show_pop()">测试按钮</button>
</div>
<div id="winpop">
<div class="title">您有新的消息<span class="close" onclick="hid_pop()">X</span></div>
<div class="con"><a href='http://avatar.csdn.net/C/8/0/1_fxh_hua.jpg'>花花</a></div>
</div>
</body>
- js 右下角 不移动 弹窗广告 带关闭按钮(不支持 谷歌)
- 带关闭按钮的右下角图片广告
- 016带关闭按钮的右下角图片广告
- js,jq 右下角广告窗
- 制作带关闭按钮的固定广告
- 对联广告,带关闭,可以移动
- 带关闭按钮的js
- 桌面右下角弹广告窗
- 不带关闭的对联广告
- js简单的弹层(带关闭按钮)
- 两边浮动图片广告代码,带关闭按钮
- 百度地图 JS API 隐藏信息弹窗自带的关闭按钮
- js代码:弹出层,带关闭按钮
- 对联广告,带关闭,可以移动(2)
- JS右下角悬浮广告代码
- JavaScript在网页右下角弹出窗口 带关闭按钮 支持谷歌浏览器
- flash对联广告代码: 两边显示 不移动 可关闭
- [C++] 自动关闭右下角弹窗
- 总结OnOK()、OnCancel()、OnClose()、OnDestroy()之间的区别(转)
- 流程控制 批处理
- 封装使用的一个小例子
- 【应用软件】JVM学习
- Check Network Type with TelephonyManager
- js 右下角 不移动 弹窗广告 带关闭按钮(不支持 谷歌)
- Linux原子操作的分析(经典)
- jxl导出Excel最全面的解释
- POI中设置Excel单元格格式
- 介绍一下Web服务器和APP服务器
- 关于IE浏览器历史记录的一些知识
- 如何快速掌握一个开源项目
- NetworkDetector: uses android.telephony.TelephonyManager to obtain telephony parameters like network
- JConsole远程连接