窗口中一直飘动的广告效果
来源:互联网 发布:vb linq 编辑:程序博客网 时间:2024/05/05 06:38
下面代码是一个漂浮广告效果,请把IMG的SRC改成你自己电脑上的一张图片的地址。
<!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>
<title>无标题页</title>
<script>...
var dx=5,dy=5;
var interval=100;
var intervalID=window.setInterval('moveDiv()',interval);
function moveDiv()
...{
if(window.closed)
...{
clearInterval(intervalID);
}
window.status=document.getElementById('swfDiv').style.posLeft+dx;
//(window.screen.availWidth-100) (window.screen.availHeight-80)
if(((document.getElementById('swfDiv').style.posLeft+dx)>800)||((document.getElementById('swfDiv').style.posLeft+dx)<0))
...{
dx=-dx;
}
if(((document.getElementById('swfDiv').style.posTop+dy)>445)||((document.getElementById('swfDiv').style.posTop+dy)<0))
...{
dy=-dy;
}
document.getElementById('swfDiv').style.posLeft += dx;
document.getElementById('swfDiv').style.posTop += dy;
}
</script>
</head>
<body>
<div id="swfDiv" style="width:100px; height:80px; position:absolute; top:0; left:0; z-index:99; border-bottom:solid 1px black; border-left:solid 1px black; border-right:solid 1px black; border-top:solid 1px black">
<img src="{67A7B337-4419-4361-92CC-F8FC3F445680}.JPG" />
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script>...
var dx=5,dy=5;
var interval=100;
var intervalID=window.setInterval('moveDiv()',interval);
function moveDiv()
...{
if(window.closed)
...{
clearInterval(intervalID);
}
window.status=document.getElementById('swfDiv').style.posLeft+dx;
//(window.screen.availWidth-100) (window.screen.availHeight-80)
if(((document.getElementById('swfDiv').style.posLeft+dx)>800)||((document.getElementById('swfDiv').style.posLeft+dx)<0))
...{
dx=-dx;
}
if(((document.getElementById('swfDiv').style.posTop+dy)>445)||((document.getElementById('swfDiv').style.posTop+dy)<0))
...{
dy=-dy;
}
document.getElementById('swfDiv').style.posLeft += dx;
document.getElementById('swfDiv').style.posTop += dy;
}
</script>
</head>
<body>
<div id="swfDiv" style="width:100px; height:80px; position:absolute; top:0; left:0; z-index:99; border-bottom:solid 1px black; border-left:solid 1px black; border-right:solid 1px black; border-top:solid 1px black">
<img src="{67A7B337-4419-4361-92CC-F8FC3F445680}.JPG" />
</div>
</body>
</html>
- 窗口中一直飘动的广告效果
- JS的飘动窗口特效
- 用C#制作飘动的窗体效果
- 用C#制作飘动的窗体效果
- 用C#制作飘动的窗体效果
- Android实现飘动的旗帜效果实例
- android 一直在最前面的浮动窗口效果
- Android中一直走马灯效果的TextView
- Android中一直走马灯效果的TextView
- 如何调用飘动窗口
- 【Qt OpenGL教程】11:旗帜效果(飘动的纹理)
- 雪花飘飘动画效果
- InfoQ的广告效果
- 对联效果的广告
- 缓冲效果的广告
- 广告的效果
- jQuery图片飘动--图片在浏览器窗口飘动
- 一直处于网页中间的滚动广告
- DoS攻击
- TreeView存储过程动态绑定树控件
- 测试用例
- win32下FreeType2的编译
- 我对轻量级(struts+spring+hibernate)j2ee的理解(二)
- 窗口中一直飘动的广告效果
- 用C++Builder2007+dbexpress 4.0 +mysql发布程序时的问题及解决
- 风讯生成静态文件研究调查(测试中)
- Asp.net 利用Repeater和ObjectDataSource 实现自定义分页控件
- 论计算机专业的学习与就业
- 数据库分离,附加
- 细说SCA V1.0规范(2) --Composite与架构
- 右键菜单支持DOS命令提示符号
- windows上搭建自己的搜索引擎nutch