javascript - Hide scrollbar (with scroll enabled) - Stack Overflow

I have a table with 2 columns and multiple rows<table border=0 id="feed"><tr><

I have a table with 2 columns and multiple rows

<table border=0 id="feed">
    <tr><td>something</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something1</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something2</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something3</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something4</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something5</td><td><div class="bubble"></div></td></tr>
    <tr><td>something-else1</td><td><div class="bubble"></div></td></tr>
    <tr><td>something-els2</td><td><div class="bubble"></div></td></tr>
</table>

I want to be able to scroll down without showing the scrollbar (implying that the total height of the rows exceed the 800px limit) . I am looking for a Chrome/Firefox patible fix.

Current properties of feed:

  #feed{
    display: block;height: 800px;overflow-y: scroll;
}

This only works on the chrome framework:

#feed::-webkit-scrollbar { 
    display: none; 
}

EDIT:

I tried adding a parent to the table (according to Hide scroll bar, but still being able to scroll):

#outer{
    overflow-y:hidden;
    height:800px;
}
#feed{overflow:scroll;}

HTML:

<div id="outer"><table border=0 id="feed">...</table></div>

Please note that the total height is bigger than 800px so scrolling should work. It does not, though.

I have a table with 2 columns and multiple rows

<table border=0 id="feed">
    <tr><td>something</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something1</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something2</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something3</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something4</td><td><div class="bubble"></div></td></tr>
    <tr><td style="">something5</td><td><div class="bubble"></div></td></tr>
    <tr><td>something-else1</td><td><div class="bubble"></div></td></tr>
    <tr><td>something-els2</td><td><div class="bubble"></div></td></tr>
</table>

I want to be able to scroll down without showing the scrollbar (implying that the total height of the rows exceed the 800px limit) . I am looking for a Chrome/Firefox patible fix.

Current properties of feed:

  #feed{
    display: block;height: 800px;overflow-y: scroll;
}

This only works on the chrome framework:

#feed::-webkit-scrollbar { 
    display: none; 
}

EDIT:

I tried adding a parent to the table (according to Hide scroll bar, but still being able to scroll):

#outer{
    overflow-y:hidden;
    height:800px;
}
#feed{overflow:scroll;}

HTML:

<div id="outer"><table border=0 id="feed">...</table></div>

Please note that the total height is bigger than 800px so scrolling should work. It does not, though.

Share Improve this question edited May 23, 2017 at 12:03 CommunityBot 11 silver badge asked Mar 5, 2014 at 10:00 GabeGabe 9711 gold badge10 silver badges23 bronze badges 3
  • 1 How are you expecting people to scroll (or even know that there is hidden content that can be scrolled to) without showing a scroll bar? overflow: hidden would seem to fit what you want, but it would be terrible UX. – Rory McCrossan Commented Mar 5, 2014 at 10:01
  • Check this link – Mr_Green Commented Mar 5, 2014 at 10:02
  • @RoryMcCrossan No, that disables the scroll capability. In the context I work in, the existence of the "hidden content" can be deducted upon scrolling a list of msgs. – Gabe Commented Mar 5, 2014 at 10:07
Add a ment  | 

2 Answers 2

Reset to default 3

You can do it like this:

#feed{
    display: block;
    height: 100px;
    overflow-y: scroll;
    margin-right: -30px;
}

#outer{
    overflow:hidden;
}
#feed{
    display: block;
    height: 800px;
    overflow-y: hidden;
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745277627a4620128.html

相关推荐

  • javascript - Hide scrollbar (with scroll enabled) - Stack Overflow

    I have a table with 2 columns and multiple rows<table border=0 id="feed"><tr><

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信