admin管理员组文章数量:1202373
I am not getting a scroll-bar for box in chrome but getting in fire fox and internet explorer
li.box{
border-radius: 0px;
padding:0;
border: solid 1px #8c8d8e;
overflow: hidden;
overflow-y:scroll;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #ffffff;
opacity: 0.85;
}
this is JSFiddle link /
I am not getting a scroll-bar for box in chrome but getting in fire fox and internet explorer
li.box{
border-radius: 0px;
padding:0;
border: solid 1px #8c8d8e;
overflow: hidden;
overflow-y:scroll;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #ffffff;
opacity: 0.85;
}
this is JSFiddle link http://jsfiddle.net/wydsf2vk/
Share Improve this question edited Sep 12, 2014 at 12:10 AKG asked Sep 12, 2014 at 11:50 AKGAKG 2211 gold badge3 silver badges9 bronze badges 10- can you provide us with a jsfiddle example? – Hristo Valkanov Commented Sep 12, 2014 at 11:52
- can you plz put a jsfiddle.net so we can fix it for u – Dany Minassian Commented Sep 12, 2014 at 11:52
- thanks for reply , this is working in jsfiddle but i my project this is not working – AKG Commented Sep 12, 2014 at 11:57
- your using chrome while on jsfiddle ? – Dany Minassian Commented Sep 12, 2014 at 11:58
- hi i have updated jsfiddle link can you please check its not working in js fiddle also – AKG Commented Sep 12, 2014 at 12:05
7 Answers
Reset to default 6Add height property to your css class, to display scrollbar you need to set fix height of your div.
Are you by chance using a track pad instead of a mouse, on OSX? There's some quirk where the scrollbar will be hidden if you're using a track pad. Plug in a mouse and see if it appears.
Set max-height for that .box it will work
You are missing the height
CSS property. check snippet below.
.box {
border-radius: 0px;
padding:0;
border: solid 1px #8c8d8e;
overflow: hidden;
overflow-y:scroll;
height: 100px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #ffffff;
opacity: 0.85;
}
<div class="box">
<p> Hello World 1 </p>
<p> Hello World 2 </p>
<p> Hello World 3 </p>
<p> Hello World 4 </p>
<p> Hello World 5 </p>
</div>
This is an OLD issue, but I am posting the workaround if its the Trackpad causing your scroll bar to disappear, try the following:
Go to System Preferences. Search for 'Show Scroll Bars' Choose Always.
I just checked your fiddle, that's happening because you've not added the overflow-y: scroll;
property to the fiddle. It does work for my version (Chrome too).
http://jsfiddle.net/y8jqsya4/
change your css:-
height:100px
border-radius: 0px;
padding:0;
border: solid 1px #8c8d8e;
overflow: hidden;
overflow-y:scroll;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #ffffff;
opacity: 0.85;
http://jsfiddle.net/wydsf2vk/2/
本文标签: javascriptoverflowyscroll is not working for chromeStack Overflow
版权声明:本文标题:javascript - overflow-y:scroll is not working for chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738647254a2104660.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论