| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1906 人关注过本帖
标题:一个小问题,可是困扰了我两天了,help
只看楼主 加入收藏
我很无知
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2004-8-13
收藏
 问题点数:0 回复次数:1 
一个小问题,可是困扰了我两天了,help

我在主页左侧做了一个广告,可以与窗口位置相对静止的那种,我想在右边也做一个同样的,可是复制粘贴根本不对,教教我怎么做啊,做出来就像sohu的两边的广告一样,左边的代码是在特效工具上抄的<div id="KBStatic" style="position:absolute; left:19px; top:341px; width:67px; height:80px; z-index:25"> <a href="http..."> <img src="images/ad.jpg" width="68" height="176" border="0"></a> </div> <p> <script language=JavaScript> function KB_keepItInIE(theName,theWantTop,theWantLeft) { theRealTop=parseInt(document.body.scrollTop) theTrueTop=theWantTop+theRealTop document.all[theName].style.top=theTrueTop theRealLeft=parseInt(document.body.scrollLeft) theTrueLeft=theWantLeft+theRealLeft document.all[theName].style.left=theTrueLeft } function KB_keepItInNN(theName,theWantX,theWantY) { theRealLay=document.layers[theName] theBadX=self.pageYOffset theBadY=self.pageXOffset theRealX=theBadX+theWantX theRealY=theBadY+theWantY theRealLay.moveTo(theRealY,theRealX) } IE4=(document.all)?1:0 NN4=(document.layers)?1:0 if (IE4) setInterval('KB_keepItInIE("KBStatic",350,30)',1) if (NN4) setInterval('KB_keepItInNN("KBStatic",30,50)',1) </script>

搜索更多相关主题的帖子: help 广告 sohu 困扰 
2004-08-13 15:13
大光
Rank: 1
等 级:新手上路
帖 子:100
专家分:0
注 册:2004-5-25
收藏
得分:0 

<div id="KBStatic" style="position:absolute; left:19px; top:341px; width:67px; height:80px; z-index:25">

绝对定位的元素,不好做成两边对称的两个广告条。改变窗口大小,右边的可能就出界了。

最好是在表格里做成:position:relative; 的.

2004-08-16 15:28
快速回复:一个小问题,可是困扰了我两天了,help
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016761 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved