浮动广告

----------------------------没有关闭和链接的浮动广告--------------------------------------------

<div id="img" style="position:absolute;">
  <img src=""
  onMouseover="clearInterval(interval)" οnmοuseοut="interval = setInterval('changePos()',30);">
</div>
<script LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://www.smallrain.net -->

<!-- Begin
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;
var name = navigator.appName;
if(name == "Microsoft Internet Explorer") name = true;
else name = false;
var xPos = 20;
if(name) var yPos = document.body.clientHeight;
else var yPos = window.innerHeight;
function changePos() {
if(name) {
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;
}
else {
height = window.innerHeight;
width = window.innerWidth;
Hoffset = document.img.clip.height;
Woffset = document.img.clip.width;
document.img.pageY = yPos + window.pageYOffset;
document.img.pageX = xPos + window.pageXOffset;
}
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() {
if(name) img.visibility = "visible";
else document.img.visibility = "visible";
interval = setInterval('changePos()',delay);
}
start();
//  End -->
</script> 

------------------------------带有链接和关闭的浮动广告----------------------------------------

<SPAN id=img οnmοuseοver=mystop()
style="POSITION: absolute; right: 0px;Z-INDEX: 7" οnmοuseοut=start()><A
href="http://www.163.com"
target=_blank><IMG src="D:\baohua.jpg" border=0></A><BR>
<DIV class=font align=right style="Z-INDEX: 7"><a href="javascript:hide();">关闭</a><iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:283px; height:209px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe></DIV></SPAN>
<SCRIPT language=javascript>
var xPos = 0;var yPos = 0; var step = 1;var delay = 10;var height = 0; var Hoffset = 0;var Woffset = 0; var yon = 0;var xon = 0; var xon = 0; var interval;
var img = document.getElementById('img');
img.style.top = 0;
function hide()
{
img.style.display = 'none';
document.getElementById('imgFlag').value=1;
}
function changePos(){
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.right = 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 mystop()
{
clearInterval(interval)
}
start()
</SCRIPT>
<script language=JavaScript>
var xPos2 = 0; // 起始横向位置(从左算起,单位象素)
var yPos2 = 0;//document.body.clientHeight;  页面本身高度
var step2 = 1;
var delay2 = 10; // 速度,值越大速度越慢
var height2 = 0;
var Hoffset2 = 0;
var Woffset2 = 0;
var yon2 = 0;
var xon2 = 0;
var pause2 = true;
var interval2;
var img2 = document.getElementById('img2');
img2.style.top = 0;
//dd.style.top = yPos;
function changePos2() {
width2 = document.body.clientWidth; // 判断浏览器窗口的宽度
height2 = document.body.clientHeight; // 判断浏览器窗口的高度
Hoffset2 = img2.offsetHeight;
Woffset2 = img2.offsetWidth;
img2.style.left = xPos2 + document.body.scrollLeft;
img2.style.top = yPos2 + document.body.scrollTop;
if (yon2) {
yPos2 = yPos2 + step2;
}
else {
yPos2 = yPos2 - step2;
}
if (yPos2 < 0) {
yon2 = 1;
yPos2 = 0;
}
if (yPos2 >= (height2 - Hoffset2)) {
yon2 = 0;
yPos2 = (height2 - Hoffset2);
}
if (xon2) {
xPos2 = xPos2 + step2;
}
else {
xPos2 = xPos2 - step2;
}
if (xPos2 < 0) {
xon2 = 1;
xPos2 = 0;
}
if (xPos2 >= (width2 - Woffset2)) {
xon2 = 0;
xPos2 = (width2 - Woffset2);
}
}
function start2() {
img2.visibility = "visible";
interval2 = setInterval('changePos2()', delay2);
}
function hide2()
{
img2.style.display = 'none';
document.getElementById('imgFlag').value=1;
}
function mystop2()
{
clearInterval(interval2)
}
start2();
</script>
<body>
 <form>
 <html:hidden property="imgFlag" value="0"/>//设置一个imgFlag对象。
</form>
</body>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【1】项目代码完整且功能都验证ok,确保稳定可靠运行后才上传。欢迎下载使用!在使用过程中,如有问题或建议,请及时私信沟通,帮助解答。 【2】项目主要针对各个计算机相关专业,包括计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网等领域的在校学生、专业教师或企业员工使用。 【3】项目具有较高的学习借鉴价值,不仅适用于小白学习入门进阶。也可作为毕设项目、课程设计、大作业、初期项目立项演示等。 【4】如果基础还行,或热爱钻研,可基于此项目进行二次开发,DIY其他不同功能,欢迎交流学习。 【注意】 项目下载解压后,项目名字和项目路径不要用中文,否则可能会出现解析不了的错误,建议解压重命名为英文名字后再运行!有问题私信沟通,祝顺利! 基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip基于C语言实现智能决策的人机跳棋对战系统源码+报告+详细说明.zip
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值