网页编程网
www.youkud.com
掌握计算机、网络技术,让生活更美好!
主页
网页制作
html5
JavaScript
DIV+CSS
前端美工
网络编程
Java与JSP
PHP
Python 3
Golang
R语言
数据库
Mysql
Oracle
NoSQL
SQLite
运维
Linux
正则表达式
架构
网页特效
移动开发
网络
SDN
QUIC
网络原理
人工智能
强化学习
机器学习
区块链
区块链1
区块2
dapp
理论
dapp案例
数据采集
爬虫技术
爬虫案例
当前位置:
主页
>>
网页特效
>> 正文
带关闭功能全屏漂浮广告图片
阅读:3913 输入:2016-08-23 09:10:21
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>带关闭按钮的网页漂浮广告代码</title> </head> <body> <div id="img" style="position: absolute; left: 311; top: 815;visibility :hidden;" onmouseover="clearInterval(interval)" onmouseout="interval = setInterval('changePos()', delay)" align="right"> <a href="#" target="_blank"><img border="0" src="http://youkud.com/image/banner4.jpg" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/></a> <span style="CURSOR:hand;color:red;font-weight:bold" onclick="clearInterval(interval);img.style.visibility = 'hidden'">X</span> </div> <script language=javascript> var xPos = 20;//from alixixi.com var yPos = document.body.clientHeight; var step = 1; var delay = 30; var height = 0; var Hoffset = 0; var Woffset = 0; var yon = 0; var xon = 0; var pause = true; var interval; img.style.top = yPos; function changePos() { width = document.body.clientWidth; height = document.body.clientHeight; Hoffset = img.offsetHeight; Woffset = img.offsetWidth; img.style.left = xPos + document.body.scrollLeft; img.style.top = yPos + document.body.scrollTop; if (yon) { yPos = yPos + step; } else { yPos = yPos - step; } if (yPos < 0) { yon = 1; yPos = 0; } if (yPos >= (height - Hoffset)) { yon = 0; yPos = (height - Hoffset); } if (xon) { xPos = xPos + step; } else { xPos = xPos - step; } if (xPos < 0) { xon = 1; xPos = 0; } if (xPos >= (width - Woffset)) { xon = 0; xPos = (width - Woffset); } } function start() { img.style.visibility = "visible"; interval = setInterval('changePos()', delay); } start(); </script> </body> </html>
上一篇:
js实现复选框全选反选特效
下一篇:
纯js两组文字定时向上滚动特效
相关阅读
js实现图片无缝向上循环滚动特效
js实现文字内容向上滚动效果
JS横向带停顿的图片无缝滚动特效
下载专区
软件下载(提取码:mtag)
Tag
网站Tag
标签云
HTML工具
进制间转换
进制转换(带小数)
html代码运行
HTML工具
字母翻转
硬盘整数分区
html颜色代码
HTML工具
除空格回车
万年历
fojiao
HTML工具
小游戏
在线绘画
更多
手机版
联系微信:jingqishens