js飘浮广告(可以为jpg.gif.flash文件)
2005-09-30 16:20
519 查看
<html>
<head>
<title>html-中国站长站www.chinaz.com</title>
</head>
<body>
<div id="img" style="position:absolute;z-index=99;">
<img src="jsimg/cursor.gif" onClick="pause_resume();" border="0" alt='img'>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var xPos = document.body.clientWidth-20;
var yPos = document.body.clientHeight/2;
var step = 1;
var delay = 5;
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.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume() {
if(pause) {
clearInterval(interval);
pause = false;
}else {
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();
// End -->
</script>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>
<head>
<title>html-中国站长站www.chinaz.com</title>
</head>
<body>
<div id="img" style="position:absolute;z-index=99;">
<img src="jsimg/cursor.gif" onClick="pause_resume();" border="0" alt='img'>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var xPos = document.body.clientWidth-20;
var yPos = document.body.clientHeight/2;
var step = 1;
var delay = 5;
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.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume() {
if(pause) {
clearInterval(interval);
pause = false;
}else {
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();
// End -->
</script>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href'></div>
相关文章推荐
- js验证上传的文件是否为JPEG,PNG,JPG,GIF格式
- 利用js提交数据给服务器 可以很秘密的提交数据到服务器 运行会访问 一个gif文件
- js验证上传的文件是否为JPEG,PNG,JPG,GIF格式
- js 在<input type='file'/>的使用中,控制文件的后缀jpg gif等
- SPRING-MVC访问静态文件,如jpg,js,css
- 页面嵌入js文件就可以出现可拖动的悬浮球
- js 实现检查上传文件的格式,文件为.jpg或.png为正确格式,其它为错误。
- js上的Ajax和cookie(可以直接放在js文件上使用)
- vue.js使用webpack发布,部署到服务器上之后在浏览器中可以查看到vue文件源码
- JAVA读取EMF文件并转化为PNG,JPG,GIF格式
- [导入]关于iCast等“富媒体”广告的研究(三)--附JS文件
- springMVC3学习(四)--访问静态文件如js,jpg,css
- js浮动固定层(对联飘浮广告,随滚动条浮动)
- Vagrant下共享目录静态文件(js/jpg/png等)“缓存”问题
- php取swf/jpg/gif/png,bmp等文件宽和高相关属性
- 各大门户网站Flash和JS实现的图片幻灯片切换特效代码文件下载:
- js动态加载js css文件,可以配置文件后辍,防止浏览器缓存
- FILEtoJPG-神秘文件 -更新(软件BUG及建议可以在这里反馈)
- 用JavaScript获取网页中的js、css、Flash等文件
- 基于boost判断jpg文件结尾的2个字节是否正确,可以用来判断JPG文件是否完整。