javascript 或css有没有办法将滚动条隐藏,用标滚轮滚动超出的内容

arrowwhite 2011-05-27 03:29:29
一此文本为例?
隐藏段落层的滚动条,但可以动过鼠标滚轮查看超出的类容。
<html>
<head>
<style type="text/css">

#apDiv1 {
position:absolute;
width:400px;
height:315px;
z-index:0;
border:#F00 1px solid;
float:right;
display:inline-block;
left: 293px;
top: 86px;
overflow-y:auto
}

.head{
border:#999 1px solid;
height:150px;


}
</style>
</head>

<body>


<div id="apDiv1">
<div class="head" ></div>
<div style="overflow-y:auto; height:150px;">

<p> This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text12.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. </p>
</div>
</div>
</body>

</html>
...全文
338 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Acesidonu 2011-05-27
  • 打赏
  • 举报
回复
用div放在滚动条上挡住滚动条,但没啥意义。还是用1楼的方法吧。
arrowwhite 2011-05-27
  • 打赏
  • 举报
回复
也可以,难道只能这样了?我模糊记得以前见过类似结构的
hyc0204 2011-05-27
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 fengyun817 的回复:]

好像不行吧。一般滚动条就是告诉别人内容不能完全显示的,你去掉了别人都不知道内容是不是都显示了。
不建议这么做。
以下是鼠标覆盖时显示滚动条,否则不显示
HTML code

<div id="apDiv1">
<div class="head" ></div>
<div style="overflow-y:hidden; height:150px;" onmouseover="this.……
[/Quote]这个就不错
fengyun817 2011-05-27
  • 打赏
  • 举报
回复
好像不行吧。一般滚动条就是告诉别人内容不能完全显示的,你去掉了别人都不知道内容是不是都显示了。
不建议这么做。
以下是鼠标覆盖时显示滚动条,否则不显示

<div id="apDiv1">
<div class="head" ></div>
<div style="overflow-y:hidden; height:150px;" onmouseover="this.style.overflowY='auto'" onmouseout="this.style.overflowY='hidden'">

<p> This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text12.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. </p>
</div>
</div>

87,989

社区成员

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

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