使用CSS/jQuery自定义垂直滚动条 [英] customizing vertical scrollbar with css/jquery

查看:129
本文介绍了使用CSS/jQuery自定义垂直滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个<div id="content">的div,其中有一些<p>标记.我将div的样式设置如下:

I have a div as <div id="content"> with some <p> tags within it. I am setting the style for div as follows:

#content{
     height:200px;
     overflow-y:scroll;
}

有没有一种方法可以自定义滚动条.我的意思是我想更改滚动条颜色及其背景.

Is there a way I can customize the scrollbar. I mean I want to change the scrollbar color as well as its background.

推荐答案

没有有效的跨浏览器代码,该代码能够为滚动条着色.您应该尊重正在访问您页面的用户的UI配置.

There is no valid cross-browser code, which is capable of coloring the scrollbars. You should respect the UI configuration of the users who are visiting your page.

也许您想拥有完全可定制的jQuery滚动条: http://www.net-kit.com/jquery-custom-scrollbar-plugins/

Maybe you want to have jQuery scrollbars, which are fully customizable: http://www.net-kit.com/jquery-custom-scrollbar-plugins/

这篇关于使用CSS/jQuery自定义垂直滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆