Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说
浮动的广告代码_小游戏跳广告脚本,希望能够帮助你!!!。
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var x = 1,y = 1,movex = 0,movey = 0;
function movead()
{
var divObj = document.getElementById("adid");
movex = movex + x*5;
movey = movey + y*5;
divObj.style.top = movey;
divObj.style.left = movex;
if(movex+divObj.offsetWidth>=document.body.clientWidth)
x = -1;
else if(movex<=0)
x = 1;
if(movey+divObj.offsetHeight>=document.body.clientHeight)
y = -1;
else if(movey <=0)
y = 1;
}
var timeid;
function over()
{
clearInterval(timeid);
}
function out()
{
fly();
}
function fly()
{
timeid = setInterval("movead()",10);
}
window.onload = function()
{
fly();
}
function closead()
{
var divObj = document.getElementById("adid");
divObj.style.display = "none";
over();
}
</script>
</head>
<body>
<input type="button" value="手动广告" οnclick="movead()" /><br />
<div id="adid" style="position:absolute; top:0px; left:0px" οnmοuseοver="over()" οnmοuseοut="out()"><a href="http://www.sss.com.cn" target="_blank"><img src="2.jpg" height="100px" width="150px" /></a><br/>
<a href="javascript:void(0)" οnclick="closead()">关闭</a></div>
<img src="1.jpg" height="600" width="700" border="2" />
</body>
</html>
今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
上一篇
已是最后文章
下一篇
已是最新文章