社区
JavaScript
帖子详情
怎样使
做的层不随滚动条的移动而移动
太古盟约
2002-04-19 11:15:33
不用frameset解决,例如:我想使 www.csdn.net 中“首 页 | 综 合 | 技 术 | 论 坛 | 人 才 | 商 城 | 大本营 |《程序员》| 软 件”以上部分始终显示,不管下面内容有多少,自始至终我都能看到,而不滚动到上边去。
...全文
243
9
打赏
收藏
怎样使<div>做的层不随滚动条的移动而移动</div>
不用frameset解决,例如:我想使 www.csdn.net 中“首 页 | 综 合 | 技 术 | 论 坛 | 人 才 | 商 城 | 大本营 |《程序员》| 软 件”以上部分始终显示,不管下面内容有多少,自始至终我都能看到,而不滚动到上边去。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
qiushuiwuhen
2002-04-19
打赏
举报
回复
http://www.blueidea.com/bbs/newsdetail.asp?id=418813
http://www.blueidea.com/bbs/newsdetail.asp?id=434955
night_elves
2002-04-19
打赏
举报
回复
用dreamwear4 的一个插件:Nirvana Floating Layer
(若找不到,可发邮件向我索要:night_elves@msn.com)
seabell
2002-04-19
打赏
举报
回复
<script language=JavaScript>
speed=200;
pageheight=0;
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
}
setInterval('KB_keepItInIE("KBStatic",0,0)',1)
</script>
<body>
<SCRIPT>
for(i=100; i<140; i++){
document.write("◇◇"+i+"◇◇<br>")
}
</SCRIPT>
<div id="KBStatic" style="position:absolute; left:3px; top:0px; width:553px; height:70px; z-index:25">
********************************************************************************</div>
</body>
linhaibo
2002-04-19
打赏
举报
回复
好。。。
weidegong
2002-04-19
打赏
举报
回复
<div id="style1" style="background:green;position: absolute; left: 0; top: 0; width: 100%; height: 20px">
你看,你看,月亮偷偷地在改变
</div>
<script>
x0=parseInt(style1.style.left);
y0=parseInt(style1.style.top);
function window.onscroll(){
y=document.body.scrollTop;
x=document.body.scrollLeft;
style1.style.top=y0+y;
style1.style.left=x0+x;
}
</script>
<body magin=0 rightmagin=0>
<table style="width:100%;magin=0">
<tr style="20px"><td>
<tr><td>
<script>
for(i=100; i<140; i++){
document.write("◇◇"+i+"◇◇<br>")
}
</script>
</table>
</body>
8988
2002-04-19
打赏
举报
回复
忘了,还有这个要加上。
<body onscroll="doDiv()">
8988
2002-04-19
打赏
举报
回复
刚编的,你试试可以吗?
<div id="style1" style="position: absolute; left: 823; top: 456; width: 163; height: 57">
你看,我自岿然不动
</div>
<script>
x0=parseInt(style1.style.left);
y0=parseInt(style1.style.top);
function doDiv(){
y=document.body.scrollTop;
x=document.body.scrollLeft;
style1.style.top=y0+y;
style1.style.left=x0+x;
}
</script>
seabell
2002-04-19
打赏
举报
回复
也是一样啊
<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
}
setInterval('KB_keepItInIE("KBStatic",0,0)',1)
</script>
<body>
<SCRIPT>
for(i=100; i<140; i++){
document.write("◇◇"+i+"◇◇<br>")
}
</SCRIPT>
<div id="KBStatic" style="background:green;position:absolute; left:3px; top:0px; width:553px; height:70px; z-index:25">
********************************************************************************
<input type=button>
<table><tr><td>content</td></tr></table>
</div>
</body>
太古盟约
2002-04-19
打赏
举报
回复
to :上边几位,如果div中有table和 button怎么做啊?
div
不随
滚动条
的
移动
而改变位置
div
固定在屏幕的一个位置,不随
滚动条
的拖动而改变位置
使<
div
>
做
的
层
不随
滚动条
的
移动
而
移动
<body style="margin:0; overflow:hidden"><
div
style="position: absolute; bottom: 0">
层
永远保持在底部,而且不会出现震动~~~<img src=></
div
><
div
style="overflow:auto; width:100%; height:100
内容不随
滚动条
移动
css,css
div
不随
滚动条
移动
的实现方法
css
div
不随
滚动条
移动
的实现方法:首先创建一个示例文件;然后通过给
div
设置css属性样式为“position:fixed;”即可固定
div
不随
滚动条
移动
。本教程操作环境:Windows7系统、HTML5&&CSS3版本,该方法适用于所有品牌电脑。推荐:《css视频教程》css设置
div
不随
滚动条
移动
把一个内容固定到某一个位置 ,相对与浏览器窗口进行定位就可以了。这里使用的是...
vue页面实现<
div
>块初始化隐藏,随
滚动条
滚动到一定位置显示的功能
【代码】vue页面实现块初始化隐藏,随
滚动条
滚动到一定位置显示的功能。
Jquery实现
div
层
随
滚动条
滚动而滚动
针对网页
div
层
浮动,随
滚动条
滚动而
移动
,在各大门户网站上可以说随处可见。下面就应用系统实现
div
浮动实例说明: 应用系统展现内容时,由于内容过多,返回按钮放到页头或页末,对用户来说操作都不方面。这个实例就是实现
div
层
“返回”按钮随
滚动条
滚动而滚动。 html代码: 返回
JavaScript
87,996
社区成员
224,693
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章