惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - asdsd

js收藏 - asdsd - 博客园 ArrayList最佳使用建议 右下角弹出消息 用js限制用户输入字节个数 - asdsd - 博客园 数据岛与分页 SQL中CONVERT转化函数的用法 js实现自动全屏幕 - asdsd - 博客园 迅速返回页面顶部代码 - asdsd - 博客园 图示元素的clientTop、offsetTop、offsetHeight等属性 新浪天气-模拟 揭开正则表达式 javascript中获取radiobuttonlist选中值 开发时碰到的问题以及心得经验 经常用到的javaScript技术 一劳永逸 让你与IE弹出窗口彻底告别 随机排1-100数字 判断一个对象是否存在 用C#制作新闻阅读器(电脑报2005年3月14日 第10期) 遮挡的问题
滚动条的设置
asdsd · 2007-03-14 · via 博客园 - asdsd

DHTML中滚动条的设置。
 1.overflow内容溢出时的设置

overflow-x水平方向内容溢出时的设置

overflow-y垂直方向内容溢出时的设置

以上三个属性设置的值为visible(默认值)、scroll、hidden、auto。

2.scrollbar-3d-light-color立体滚动条亮边的颜色

scrollbar-arrow-color上下按钮上三角箭头的颜色

scrollbar-base-color滚动条的基本颜色

scrollbar-dark-shadow-color立体滚动条强阴影的颜色

scrollbar-face-color立体滚动条凸出部分的颜色

scrollbar-highlight-color滚动条空白部分的颜色

scrollbar-shadow-color立体滚动条阴影的颜色

scrollbar-track-color:滚动条底版颜色设定

以上八个属性设置的值都是颜色值,可以使用样式表定义的各种表达方式。

我们通过几个实例来讲解上述的样式属性:

1.让浏览器窗口永远都不出现滚动条

没有水平滚动条

<body style="overflow-x:hidden">

没有垂直滚动条

<body style="overflow-y:hidden">

没有滚动条

<body style="overflow-x:hidden;overflow-y:hidden">

<body style="overflow:hidden">


2.设定多行文本框的滚动条

没有水平滚动条

<textarea style="overflow-x:hidden"></textarea>

没有垂直滚动条

<textarea style="overflow-y:hidden"></textarea>

没有滚动条

<textarea style="overflow-x:hidden;overflow-y:hidden"></textarea>

或<textarea style="overflow:hidden"></textarea>

3.设定窗口滚动条的颜色

设置窗口滚动条的颜色为红色<body style="scrollbar-base-color:red">

scrollbar-base-color设定的是基本色,一般情况下只需要设置这一个属性就可以达到改变滚动条颜色的目的。

加上一点特别的效果:

<body style="scrollbar-arrow-color:yellow;scrollbar-base-color:lightsalmon">

Body{
scrollbar-Face-color:#FFCC00;
scrollbar-Highlight-Color:#FF0000;
scrollbar-Shadow-Color:#FFFFFF;
scrollbar-3Dlight-Color:#000000;
scrollbar-Arrow-Color:#000000;
scrollbar-Track-Color:#FDEAC4;
scrollbar-Darkshadow-Color:#FFFF00;
}

4.设定其他元素时,基本上一样,你最好是在样式表文件中定义好一个类,这样你就可以重复使用了。

.coolscrollbar {
scrollbar-arrow-color:yellow;
scrollbar-base-color:lightsalmon;
}

将以上语句加入到样式表文件中或html头部的<style></style>当中,然后使用

<textarea class="coolscrollbar"></textarea>