有没有现成的网页中广告跑来跑去的代码?
谁有麻烦贴一下? 问题点数:30、回复次数:2Top
1 楼lanothing(阿九)回复于 2004-12-03 12:58:31 得分 30
http://www.5mtv.com/java/image.htmlTop
2 楼mumasgw(公子)回复于 2004-12-03 16:08:00 得分 0
看到如下代码,但就是鼠标放上去不会停顿,不知到为什么?
<HTML>
<BODY text=#000000 bgColor=#003399 leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<div id="img" style="position:absolute;">
<a href="http://www.126.com/" target="_blank"><img src="logo1.gif" onmouseover="stopit()" onmouseout="startit()" width="90" height="50" border="0"></a>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var xPos = 20;
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 = 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);
}
start();
function startit() {
//img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function stopit() {
clearInterval(interval);
}
startit();
// End -->
</script>
</BODY>
</HTML>
Top




