图片
CSS
JS广告
便捷
下载
解答
截图
高清壁纸
后台模板
PS插件
网页特效
Css新闻
推荐代码
页面应用
技术文章
图片展示
广告条
广告代码
软件类
在线工具
常用信息
动画制作
图片处理
辅助小工具
转换软件
其他
软件问题
系统问题
网页问题
常识整理
互联网价值
网站
图标
APP
按钮
公告
2013网站频道新版上线,功能持续完善中……
02.17
更新
mac系统PS数位板没有压感解决方案
01.27
查看windows10系统是否激活
08.31
windows10激活失败,亲测最有效的解决方法
08.31
Mac OS 您需要安装旧 Java SE 6 运行环境才能打开
04.10
Adobe adobeau2017英文转换为中文[汉化方法]
04.01
Mac电脑系统翻墙方法
05.26
最全手机APP中的尺寸规范
05.12
中文WebFont解决方案Font-Spider
09.02
互联网
JS控件
按钮
黑色
灰色
白色
蓝色
绿色
黄色
橙色
>
代码
>
图层样式特效
右下角弹层广告
上一篇
下一篇
0
作者:vip_260 来源:未知 日期:2011/1/13 15:28:46 人气:
标签:
右下角弹层广告function runcode_open_new(element){var code = document.getElementById(element).value;var win = window.open("", "", "");win.opener = null
右下角弹层广告
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>右下角弹窗广告</title> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> #msg_win{border:1px solid #A67901;background:#EAEAEA; position:fixed;_position:absolute;right:0;overflow:hidden; z-index:99; display:none} #msg_win a{ color:#333;} </style> </head> <body style="height:2000px"> <script type="text/javascript"> var RBMessage={ boxW:200, boxH:101, init:function(){ var that = this; this.createBox(); document.getElementById("msg_close").onclick = function() { that.BoxWin.style.display="none"; } }, bind: function() { //绑定窗口滚动条与大小变化事件 var that = this, st, rt; window.onscroll = function() { if( !!window.ActiveXObject && !window.XMLHttpRequest ){ clearTimeout(st); clearTimeout(that.timer2); that.setOpacity(0); st = setTimeout(function() { that.BoxWin.style.top = that.getY().top; that.show(); },500); } }; window.onresize = function(){ if (!!window.ActiveXObject && !window.XMLHttpRequest) { clearTimeout(rt); rt = setTimeout(function(){ that.BoxWin.style.top = that.getY().top }, 100); } } }, show: function() { //渐显 clearInterval(this.timer2); var that = this, fx = this.fx(0, 100, 0.1), t = 0; this.timer2 = setInterval(function() { t = fx(); that.setOpacity(t[0]); if (t[1] == 0) { clearInterval(that.timer2) } }, 10); }, fx: function(a, b, c) { //缓冲计算 var cMath = Math[(a - b) > 0 ? "floor": "ceil"], c = c || 0.1; return function() { return [a += cMath((b - a) * c), a - b] } }, setOpacity: function(x) { //设置透明度 var v = x >= 100 ? '': 'Alpha(opacity=' + x + ')'; this.BoxWin.style.visibility = x <= 0 ? 'hidden': 'visible'; //IE有绝对或相对定位内容不随父透明度变化的bug this.BoxWin.style.filter = v; this.BoxWin.style.opacity = x / 100; }, getY: function() { //计算移动坐标 var d = document, b = document.body, e = document.documentElement; var s = Math.max(b.scrollTop, e.scrollTop); var h = /BackCompat/i.test(document.compatMode) ? b.clientHeight: e.clientHeight; var h2 = this.BoxWin.offsetHeight; return { foot: s + h + h2 + 2 + 'px', top: s + h - h2 - 2 + 'px' } }, moveTo: function(y) { //移动动画 clearInterval(this.timer); var that = this; var moveTopNum=-that.boxH; this.timer = setInterval(function() { moveTopNum+=5; that.BoxWin.style.bottom = moveTopNum +'px'; if (moveTopNum >= 0) { clearInterval(that.timer); that.bind(); } },50); return this; }, createBox:function(){ this.BoxWin=document.createElement('div'); this.BoxWin.style.width = this.boxW+"px"; this.BoxWin.style.height = this.boxH+"px"; this.BoxWin.style.bottom = - this.boxH+"px"; this.BoxWin.id = "msg_win"; this.BoxWin.innerHTML = '<div class="icos"><a href="javascript:void 0" title="关闭" id="msg_close">X</a></div><div id="msg_title">温馨提示(标题)</div><div id="msg_content"></div>'; document.body.appendChild(this.BoxWin); var that = this; setTimeout(function() { //初始化最先位置 that.BoxWin.style.display = 'block'; that.moveTo(); },1000); return this; } }; RBMessage.init(); </script> </body> </html>
加关注
关于我们
帮助中心
意见反馈
设计导航
Copyright 2008
网站频道
All Rights Resverved.
提供:网页特效 JS广告 网站截图 酷站推荐 交流群:3506863
页面执行时间0.0469秒 查询数据库3次