网页两侧广告滚动效果代码

syeightyl 2014-04-01 11:23:43
大大们都懂的,求个网页两侧广告滚动效果代码,能兼容各个浏览器的(IE6.0、谷歌、Firefox的)
有的只在IE下滚动,但是在谷歌内核下不滚动了。。很纠结(360浏览器啊)
谢谢大大们了
...全文
483 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
码出春天 2014-04-02
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>
			请输入标题
		</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/> 
		<meta name="keywords" content="关键词"/>
		<meta name="Description" content="描述信息"/>
		<style>
			#content{
				width:1800px;
				height:2000px;
				border:1px solid #336699;
			}

			#banner{
				width:282px;
				position:fixed;
				right:1px;
				bottom:1px;
			}

			#bannerTop{
				background-color:rgb(217,231,243);
				width:278px;
				height:30px;
				border:1px solid rgb(194,215,227);

			}

			#top1{
				width:229px;
				float:left;
				font-weight:bold;
				font-size:12px;
				height:30px;
				line-height:30px;
				text-indent:5px;
			}

			#top2{
				width:48px;
				float:left;
				
			}

			#bannerBottom{
				margin-top:1px;
			}
		</style>
		<script>
			window.onload=function(){	
				document.getElementById('ban').onclick=function(){
					//先设置广告隐藏
					//document.getElementById('banner').style.display='none';
					//过三秒执行display函数
					//setTimeout('display()',3000);

					var banner=document.getElementById('banner');
					var parent=document.getElementsByTagName('body')[0];
					parent.removeChild(banner);

				};
			};

			function display(){
				//再将广告显示出来
				document.getElementById('banner').style.display='block';
			}
		</script>
	</head>
	<body>
		<div id='banner'>
			<div id='bannerTop'>
				<div id='top1'>
					右下角固定广告
				</div>
				<div id='top2'><img id='ban' src='images/btn.gif' /></div>
			</div>
			<div id='bannerBottom'>
				<img src='images/banner.jpg' />
			</div>
		</div>
		<div id='content'></div>
	</body>
</html>
aaa8562373 2014-04-01
  • 打赏
  • 举报
回复
position:fixed
syeightyl 2014-04-01
  • 打赏
  • 举报
回复
IE11下都在一侧啊。。。而且您这是文字滚动,我想要的是图片跟着滚动条可以滚动
Gaken 2014-04-01
  • 打赏
  • 举报
回复
<script language="javascript">
  function ad(){
	document.getElementById("ad-l").style.display="none";
	document.getElementById("ad-r").style.display="none";
  }
</script>
<div id="ad-l">
	<div id="ad-l-t"><span class="font15">三张网页说明</span><br /><marquee width="84" height="130" direction="up" scrolldelay="150" onmouseover=this.stop() onmouseout=this.start()>本组题目三张网页对Google浏览器、Firefox浏览器、360极速浏览器、IE浏览器(包括IE6.0)都兼容</marquee>
    </div>
    <div id="close"><a href="#" style="cursor: hand" onclick="ad()"><img src="images/close.gif"/></a></div>
</div>
<div id="ad-r">
	<div id="ad-l-t"><span class="font15">本张网页说明</span><br /><marquee width="84" height="130" direction="up" scrolldelay="150" onmouseover=this.stop() onmouseout=this.start()>本张网页用了两个对称的广告栏,可代替文档形式的说明,并且可以关闭,广告栏采用绝对定位的定位方式,广告效果是文字滚动,文字滚动时,当鼠标移上去滚动将暂停</marquee>
    </div>
    <div id="close"><a href="#" style="cursor: hand" onclick="ad()"><img src="images/close.gif"/></a></div>
</div>
syeightyl 2014-04-01
  • 打赏
  • 举报
回复
不明白啊,求详解啊

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧