最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Hiding a scrollbar in a div - Stack Overflow

programmeradmin4浏览0评论

Is there a way using css to hide a scrollbar while still keeping its functionality? Even make it transparent or the same color of the background will be fine. Do I have to do this in JavaScript?

Is there a way using css to hide a scrollbar while still keeping its functionality? Even make it transparent or the same color of the background will be fine. Do I have to do this in JavaScript?

Share Improve this question edited Feb 10, 2011 at 22:01 thirtydot 228k49 gold badges392 silver badges353 bronze badges asked Feb 10, 2011 at 21:56 CamelCamelCamelCamelCamelCamel 5,2008 gold badges63 silver badges94 bronze badges 10
  • I don't get it - how can the user use a hidden scrollbar? – thirtydot Commented Feb 10, 2011 at 22:03
  • You can do this in jQuery using .scroll() – CamelCamelCamel Commented Feb 10, 2011 at 22:04
  • 3 Are you looking for something like this? jscrollpane.kelvinluck. / jscrollpane.kelvinluck./basic.html – thirtydot Commented Feb 10, 2011 at 22:06
  • @thirtydot Wow they are really slick man, nice find! – mylesagray Commented Feb 10, 2011 at 22:08
  • 2 There are no pure CSS solutions to this you must have some sort of JS to do these advanced modifications... – mylesagray Commented Feb 10, 2011 at 22:17
 |  Show 5 more ments

2 Answers 2

Reset to default 6
.className {
  overflow: auto;
  overflow-y: hidden;
}

The user will have to scroll using the mouse wheel I believe

Compatible with IE too...

<div style="width: 500px; height: 500px; overflow: hidden;"></div>

Source: http://www.w3schools./css/pr_pos_overflow.asp

发布评论

评论列表(0)

  1. 暂无评论