Safari 6 在 OSX 山狮中不显示滚动条 [英] Safari 6 doesn't show scrollbar in OSX mountain lion

查看:70
本文介绍了Safari 6 在 OSX 山狮中不显示滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这太奇怪了.Safari 6 似乎没有在带有 overflow-y: scroll 的元素上显示滚动条.

This is so weird. Safari 6 doesn't seem to show a scrollbar on elements with overflow-y: scroll.

<ul>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
<li>something</li>
</ul>​

ul {
    background: #f1f1f1;
    width: 400px;
    height: 300px;
    overflow-x: hidden;
    overflow-y: scroll;
}

li {
    height: 50px;
    line-height: 50px;
    background: #c1ffff;
    margin-bottom: 3px;
}​

我不想因为我的应用程序中的性能问题而强制滚动条,而且它总是在那里时看起来很难看.有没有人知道解决这个问题的方法?

I don't want to force the scrollbar because of performance issues in my app and it looks ugly when it's always there. Does anyone know of a way to fix this?

Firefox 总是显示我的滚动条,而 chrome 可以完美呈现它,只在实际滚动时显示滚动条.

Firefox always shows my scrollbar which I'm fine with and chrome renders it perfectly, only showing the scrollbar on actual scroll.

我创建了一个显示问题的小提琴:http://jsfiddle.net/mWT3X/

I've created a fiddle showing the issue: http://jsfiddle.net/mWT3X/

更新:确认它可以在 Safari 5 中呈现,但不能在 6 中呈现.Update2:这个具体和系统设置中的显示滚动条设置有关.如果我将显示滚动条设置为始终,它会正常工作.

Update: Confirmed that it does render in Safari 5 but not 6. Update2: This is specifically related to the show scroll bar settings in the system settings. If I set show scroll bars to always it will work fine.

推荐答案

在 Safari 6.0 中有一个 WebKit 错误 会导致溢出:滚动"设置为不显示滚动条的新叠加样式的元素.此问题已在 Safari 6.0.1 中解决.

In Safari 6.0 there was a WebKit bug that would cause elements with "overflow: scroll" set to not display the new overlay style of scrollbars. This issue was resolved in Safari 6.0.1.

这篇关于Safari 6 在 OSX 山狮中不显示滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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