200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > html网页中两侧浮动广告怎么做 网页两侧浮动广告图片js代码

html网页中两侧浮动广告怎么做 网页两侧浮动广告图片js代码

时间:2023-11-19 15:14:53

相关推荐

html网页中两侧浮动广告怎么做 网页两侧浮动广告图片js代码

今天做网页两侧浮动广告图片,用js代码是实现,下面是一个*.js文件,在需要用到的网页加一句代码

src="*.js">即可使用,我可弄好的,分享给有需要朋友。

leftcode1="

href='/'

target='_blank'>

src='/images/xibao.jpg' width='120'

height='250'

border='0'>

src='/images/close.gif'

onClick='javascript:window.hide()' width='25' height='25'

border='0' vspace='3'

alt=''>

"

document.write(leftcode1);

rightcode2="

href='/'

target='_blank'>

src='/images/xibao.jpg' width='120'

height='250'

border='0'>

src='/images/close.gif'

onClick='javascript:window.hide()' width='25' height='25'

border='0' vspace='3'

alt=''>

"

document.write(rightcode2);

//调用'flash'的方法

//

HEIGHT=300 TYPE="application/x-shockwave-flash" id=ad

wmode=opaque>

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.young1.style.pixelTop+=percent;

document.all.young2.style.pixelTop+=percent;

lastScrollY=lastScrollY+percent;

}

function hide() {young1.style.visibility="hidden";young2.style.visibility="hidden";

}

window.setInterval("heartBeat()",1);

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。