<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>带关闭按钮的网页漂浮广告代码webjx.com</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<body>
<div id="img" style="position: absolute; left: 200; top: 200;visibility :hidden;" onMouseOver="clearInterval(interval)" onMouseOut="interval = setInterval('changePos()', delay)" align="right">
<p>公告</p><br/>
<span class="STYLE1" style="CURSOR:hand;font-weight:bold" onClick="clearInterval(interval);img.style.visibility = 'hidden'">关闭</span></div>
<script language=javascript>
var xPos = 20;//from webjx.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 = document.getElementById("img").offsetHeight;
Woffset = document.getElementById("img").offsetWidth;
document.getElementById("img").style.left = xPos + document.body.scrollLeft;
document.getElementById("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>
这个是运动的 求修改成从屏幕右下角浮出来 然后就不动了的那种
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>带关闭按钮的网页漂浮广告代码webjx.com</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<body>
<div id="img" style="position: absolute; left: 200; top: 200;visibility :hidden;" onMouseOver="clearInterval(interval)" onMouseOut="interval = setInterval('changePos()', delay)" align="right">
<p>公告</p><br/>
<span class="STYLE1" style="CURSOR:hand;font-weight:bold" onClick="clearInterval(interval);img.style.visibility = 'hidden'">关闭</span></div>
<script language=javascript>
var xPos = 20;//from webjx.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 = document.getElementById("img").offsetHeight;
Woffset = document.getElementById("img").offsetWidth;
document.getElementById("img").style.left = xPos + document.body.scrollLeft;
document.getElementById("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>
这个是运动的 求修改成从屏幕右下角浮出来 然后就不动了的那种
http://www.ijavascript.cn/share/jsad-code-float-right-221.html这个用谷歌的时候用这个关键字:仿QQ 右下角 广告 js