JQ插件第五十一:老式漂浮广告图片
来源:互联网 发布:医院网络管理系统 编辑:程序博客网 时间:2024/04/29 00:02
jQuery.piao = { "ads": new Object, "newFloatAd": function(options) { var defaultValue = { img: "", link: "", width: "190px", height: "48px" }; var opts = $.extend(defaultValue, options || {}); var ad = document.createElement("span"); ad.id = "adId"; ad.innerHTML += "<div onclick='guanbu(this)'onmouseover='over()' onmouseout='out(this)' style='position:absolute; right:3px; top:0px;cursor:pointer;'>×</div>"; ad.DirV = true; ad.DirH = true; ad.AutoMove = true; ad.style.cursor = 'pointer'; ad.Image = new Image; ad.Seed = Math.random(); ad.Timer = setInterval("$.piao.float(" + ad.Seed + ")", 50); this.ads[ad.Seed] = ad; ad.Image.Parent = ad; ad.Image.onclick = function() { window.location.href = opts.link; } ad.style.position = "absolute"; ad.style.left = 0; ad.style.top = 0; ad.Image.src = opts.img; ad.Image.onmouseover = function() { this.Parent.AutoMove = false; } ad.Image.onmouseout = function() { this.Parent.AutoMove = true; } ad.Image.style.width = opts.width; ad.Image.style.height = opts.height; ad.appendChild(ad.Image); document.body.appendChild(ad); return ad; }, "float": function(floatId) { var ad = this.ads[floatId]; if (ad.AutoMove) { var curLeft = parseInt(ad.style.left); var curTop = parseInt(ad.style.top); if (ad.offsetWidth + curLeft > document.body.clientWidth + document.body.scrollLeft - 1) { curLeft = document.body.scrollLeft + document.body.clientWidth - ad.offsetWidth; ad.DirH = false; } if (ad.offsetHeight + curTop > document.body.clientHeight + document.body.scrollTop - 1) { curTop = document.body.scrollTop + document.body.clientHeight - ad.offsetHeight; ad.DirV = false; } if (curLeft < document.body.scrollLeft) { curLeft = document.body.scrollLeft; ad.DirH = true; } if (curTop < document.body.scrollTop) { curTop = document.body.scrollTop; ad.DirV = true; } ad.style.left = curLeft + (ad.DirH ? 1 : -1) + "px"; ad.style.top = curTop + (ad.DirV ? 1 : -1) + "px"; } }}$.piao.newFloatAd({ img: "/Images/1.jpg", link: "http://www.baidu.com" });
老效果,七八年前首页流行的漂浮广告
0 0
- JQ插件第五十一:老式漂浮广告图片
- Jquery 漂浮广告的插件
- 公告、广告漂浮移动插件
- jquery 漂浮图片广告代码
- js-网站广告图片漂浮
- 《js-图片漂浮广告代码-特效》
- 点击消失的漂浮广告图片
- 漂浮广告
- 漂浮广告
- 漂浮广告
- 漂浮广告
- 漂浮广告
- 随即广告+漂浮广告
- 悬浮广告&漂浮广告
- 在浏览器中漂浮的广告图片,当图片漂浮至浏览器边界时,自动向相反方向继续漂浮
- 超强无法拦截的网页漂浮图片广告代码
- JS漂浮广告代码,图片飘动,响应鼠标停止
- 超强无法拦截的网页漂浮图片广告代码,最小化也还在桌面漂浮
- linux下的setuid分析
- 软件工程概述
- C++类访问控制及继承
- Access 导出各种格式文件
- 数据库触发器简介与实例
- JQ插件第五十一:老式漂浮广告图片
- 大话 函数指针 和 指针函数
- android 输出信息到本地txt文本
- 关于分区和卷
- TCP的各种状态
- Java程序员必学的Hotspot JVM选项
- Oracle 绑定变量
- dijkstra算法计算单源最短路径
- Oracle协议安全审计资源