NEWS
建站資訊在BODY內(nèi)加入以下代碼:
< DIV id=floater1 style="Z-INDEX: 100; LEFT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; height: 100px;" > 左邊的東西,可以是圖片,表格 < /DIV > < DIV id=floater style="Z-INDEX: 100; RIGHT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; left: 890px;" > 右邊的東西,可以是圖片,表格 < /DIV > |
self.onError = null; currentX = currentY = 0; whichIt = null; lastScrollX = 0; lastScrollY = 0; NS = (document.layers) ? 1 : 0; IE = (document.all) ? 1: 0; function heartBeat(objectid) { if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; } if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; } if(diffY != lastScrollY) { percent = .1 * (diffY - lastScrollY); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i ) eval("document.all." objectid[i]).style.pixelTop = percent; } if(NS) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i ) eval("document." objectid[i]).top = percent; } lastScrollY = lastScrollY percent; } if(diffX != lastScrollX) { percent = .1 * (diffX - lastScrollX); if(percent > 0) percent = Math.ceil(percent); else percent = Math.floor(percent); if(IE) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i ) eval("document.all." objectid[i]).style.pixelLeft = percent; } if(NS) { objectid = objectid.split(";"); for (i = 0; i < objectid.length; i ) eval("document." objectid[i]).left = percent; } lastScrollX = lastScrollX percent; } } if(NS || IE) action = window.setInterval("heartBeat(’floater;floater1’)", 2); |
OK,成功就這么簡單!DIV內(nèi)的文字可以換成圖片和表格,ID不改就行了...
另外,記得以上代碼為了不干擾本文章的顯示,在"<>"中多加了空格,拷貝到文檔以后記得修改
本文由廣州網(wǎng)站建設(shè)公司-三行網(wǎng)絡(luò)原創(chuàng),轉(zhuǎn)載請保留版權(quán)( 廣州網(wǎng)站建設(shè)huiduochem.com )三行網(wǎng)絡(luò)——專注于企業(yè)網(wǎng)站建設(shè)、響應(yīng)式營銷型網(wǎng)站定制,歡迎來電咨詢!熱線:020-85628720、15915767698
上一篇:設(shè)計(jì)網(wǎng)站的橫幅Banner廣告語用什么字體好 下一篇:廣州網(wǎng)絡(luò)公司如何定位網(wǎng)站設(shè)計(jì)要點(diǎn)