对联广告,带关闭,可以移动
在網(wǎng)頁中加入以下代碼 兩個圖的,一個是關(guān)閉用到的,一個是廣告圖
<script language=JavaScript src="js/scroll.js"></script>?
js代碼如下:
suspendcode="<DIV id=lovexin1 style='Z-INDEX: 10; LEFT: 6px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='關(guān)閉對聯(lián)廣告'><a href='http://www.makewing.com/lanren/' target='_blank'><img src='images/ad_100x300.jpg' width='100' height='300' border='0'></a></DIV>"
document.write(suspendcode);
suspendcode="<DIV id=lovexin2 style='Z-INDEX: 10; LEFT: 896px; POSITION: absolute; TOP: 105px; width: 100; height: 300px;'><img src='images/close.gif' onClick='javascript:window.hide()' width='100' height='14' border='0' vspace='3' alt='關(guān)閉對聯(lián)廣告'><a href='http://www.makewing.com/lanren/' target='_blank'><img src='images/ad_100x300.jpg' width='100' height='300' border='0'></a></DIV>"
document.write(suspendcode);
lastScrollY=0;
function heartBeat(){
diffY=document.body.scrollTop;
percent=.3*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.lovexin1.style.pixelTop+=percent;
document.all.lovexin2.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
function hide()?
{??
lovexin1.style.visibility="hidden";
lovexin2.style.visibility="hidden";
}
window.setInterval("heartBeat()",1);
轉(zhuǎn)載于:https://www.cnblogs.com/zerogo/archive/2007/04/24/2209372.html
總結(jié)
以上是生活随笔為你收集整理的对联广告,带关闭,可以移动的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求一个男人霸气微信个性签名!
- 下一篇: 值得收藏的经典网页代码(1)