帶關閉按鈕的網頁浮動廣告代碼 頭>
X;
腳本>
身體>
ff.js程式碼
var xPos = 20;
var yPos = document.body.clientHeight
步驟= 11;
var 延遲= 30;
var 高度= 0;
var 霍夫塞特= 0;
var Woffset = 0;
var yon = 0;
var xon = 0 ;
var 暫停= true;
var 間隔;
img.style.top = yPos;
函數changePos() {
width = document.body.clientWidth
高度= document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos document.body.scrollLeft
img.style.top = y.scrollLeft; document.body.scrollTop;
if (yon) {
yPos = yPos 步驟;
}
else {
yPos = yPos - 步驟;
}
ifyPos = yPos 步驟; yon = 1;
yPos = 0;
}
if (yPos >= (高度- Hoffset)) {
yon = 0;
yPos =(高度- 霍夫塞特);
}
if (xon) {
xPos = xPos 步驟;
}
else {
xPos = xPos - 步驟;
}}
if (xPos xon = 1;
xPos = 0;
}
if (xPos >= (寬度- Woffset)) {
xon = 0;
xPos = (寬度- Woffset);
}
}
function start() {
img.style.visibility = "visible";
間隔= setInterval('changePos( )', 延遲);
}
開始();